diff --git a/manage/cmd/migration/scripts/8_roles_default_color.sql b/manage/cmd/migration/scripts/8_roles_default_color.sql new file mode 100644 index 0000000..b15fb18 --- /dev/null +++ b/manage/cmd/migration/scripts/8_roles_default_color.sql @@ -0,0 +1,9 @@ +-- update roles.color default to 0 +ALTER TABLE roles + ALTER COLUMN color SET DEFAULT 0; + +-- update all existing guild default roles to +-- color=0 +UPDATE roles + SET color = 0 +WHERE roles.id = roles.guild_id; diff --git a/schema.sql b/schema.sql index b912fe3..bb35d8b 100644 --- a/schema.sql +++ b/schema.sql @@ -519,7 +519,7 @@ CREATE TABLE IF NOT EXISTS roles ( guild_id bigint REFERENCES guilds (id) ON DELETE CASCADE, name text NOT NULL, - color int DEFAULT 1, + color int DEFAULT 0, hoist bool DEFAULT false, position int NOT NULL, permissions int NOT NULL,