runtipi/packages/worker/assets/migrations/00007-add-locale-user-col.sql
2023-11-16 20:49:27 +01:00

15 lines
335 B
SQL

-- Create locale field if it doesn't exist
ALTER TABLE "user"
ADD COLUMN IF NOT EXISTS "locale" character varying DEFAULT 'en';
-- Set default locale to en
UPDATE
"user"
SET
"locale" = 'en'
WHERE
"locale" IS NULL;
-- Set locale column to not null constraint
ALTER TABLE "user"
ALTER COLUMN "locale" SET NOT NULL;