mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: add theme_preference column to users table (#11069)
This commit is contained in:
@ -0,0 +1 @@
|
||||
ALTER TABLE users DROP COLUMN "theme_preference";
|
@ -0,0 +1,3 @@
|
||||
ALTER TABLE users ADD COLUMN "theme_preference" text NOT NULL DEFAULT '';
|
||||
|
||||
COMMENT ON COLUMN "users"."theme_preference" IS '"" can be interpreted as "the user does not care", falling back to the default theme';
|
@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Usage:
|
||||
# ./create_migration name of migration
|
||||
# ./create_migration "name of migration"
|
||||
# ./create_migration name_of_migration
|
||||
# ./create_migration.sh name of migration
|
||||
# ./create_migration.sh "name of migration"
|
||||
# ./create_migration.sh name_of_migration
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
@ -27,7 +27,7 @@ CREATE TYPE new_logintype AS ENUM (
|
||||
|
||||
ALTER TABLE users
|
||||
ALTER COLUMN login_type DROP DEFAULT, -- if the column has a default, it must be dropped first
|
||||
ALTER COLUMN login_type TYPE new_logintype USING (login_type::text::new_logintype), -- converts the old enum until the new enum using text as an intermediary
|
||||
ALTER COLUMN login_type TYPE new_logintype USING (login_type::text::new_logintype), -- converts the old enum into the new enum using text as an intermediary
|
||||
ALTER COLUMN login_type SET DEFAULT 'password'::new_logintype; -- re-add the default using the new enum
|
||||
|
||||
DROP TYPE login_type;
|
||||
|
Reference in New Issue
Block a user