-- Add tarique@creatoactive.com to CRM users
-- Corporate: run 20250304000001_add_tarique_corporate.sql in Corporate/supabase
-- Learn: allows all authenticated

INSERT INTO users (role, full_name, email)
SELECT ur.id, 'Tarique Khan', 'tarique@creatoactive.com'
FROM user_roles ur
WHERE ur.name = 'Admin'
LIMIT 1
ON CONFLICT (email) DO UPDATE SET
  full_name = EXCLUDED.full_name,
  role = (SELECT id FROM user_roles WHERE name = 'Admin' LIMIT 1);
