-- Add unique constraint to email
ALTER TABLE profiles ADD CONSTRAINT profiles_email_key UNIQUE (email);

-- Insert or update the admin user
INSERT INTO profiles (id, email, username, full_name, role, is_active)
VALUES (gen_random_uuid(), 'cappadociaturkeytour@gmail.com', 'muhammet_ozsahin', 'Muhammet Özşahin', 'admin', true)
ON CONFLICT (email) DO UPDATE 
SET role = 'admin', full_name = 'Muhammet Özşahin', username = 'muhammet_ozsahin';
