-- Update investigator fields to dropdown with filtering
UPDATE form_elements
SET type_id = (SELECT id FROM element_types WHERE name = 'dropdown' LIMIT 1),
    options_table = 'users',
    options_label_column = 'full_name',
    options_value_column = 'id',
    validation = '{"filter_columns":{"groups.name":["Investigators"]}}'
WHERE field_name = 'investigator_id'
  AND form_id BETWEEN 13 AND 20;
