mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 02:32:57 +00:00
8 lines
282 B
SQL
8 lines
282 B
SQL
-- 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';
|