-- Temporarily disable the sync trigger to allow user creation
-- The trigger was causing "Database error saving new user" on invite

-- Drop the problematic trigger
DROP TRIGGER IF EXISTS sync_user_xp_on_auth_insert ON auth.users;

-- Drop the function too
DROP FUNCTION IF EXISTS sync_user_xp_user_id();

-- Note: After inviting users, we can manually sync user_ids with:
-- UPDATE user_xp SET user_id = au.id
-- FROM auth.users au WHERE user_xp.email = au.email AND user_xp.user_id != au.id;
