This commit is contained in:
Tomas Dvorak
2025-10-23 22:26:50 +02:00
parent 63700eedb2
commit 70ea0c3c91
75 changed files with 3337 additions and 1160 deletions
@@ -0,0 +1,7 @@
-- 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';