-- First, ensure the user exists in the auth.users table
-- This user needs to sign up through the application first

-- Then update their profile to admin role
UPDATE profiles 
SET role = 'admin' 
WHERE email = 'freefire.max2050@gmail.com';

-- If the profile doesn't exist yet, insert it
INSERT INTO profiles (id, email, role)
SELECT 
  auth.users.id,
  'freefire.max2050@gmail.com',
  'admin'
FROM auth.users 
WHERE auth.users.email = 'freefire.max2050@gmail.com'
AND NOT EXISTS (
  SELECT 1 FROM profiles WHERE email = 'freefire.max2050@gmail.com'
);

-- Verify the admin user was created
SELECT id, email, role, created_at 
FROM profiles 
WHERE email = 'freefire.max2050@gmail.com';
