-- Set default role to 'fan' and backfill existing records ALTER TABLE IF EXISTS users ALTER COLUMN role SET DEFAULT 'fan'; -- Backfill NULL/empty/user -> fan (do not touch admin/editor) UPDATE users SET role = 'fan' WHERE role IS NULL OR btrim(role) = '' OR lower(role) = 'user';