-- Fix existing users without roles - set default role to 'investigator'
UPDATE users 
SET roles = ARRAY['investigator']::text[]
WHERE roles IS NULL OR array_length(roles, 1) IS NULL;

-- Verify
SELECT id, email, display_name, roles FROM users;

