schema.sql: change roles.color default to 0

fixes the at-everyone role being black.

related to !6.

 - migration.scripts: add 8_roles_default_color
This commit is contained in:
Luna 2018-12-02 22:48:01 -03:00
parent 3fbaf15c1a
commit a0129da198
2 changed files with 10 additions and 1 deletions

View File

@ -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;

View File

@ -519,7 +519,7 @@ CREATE TABLE IF NOT EXISTS roles (
guild_id bigint REFERENCES guilds (id) ON DELETE CASCADE, guild_id bigint REFERENCES guilds (id) ON DELETE CASCADE,
name text NOT NULL, name text NOT NULL,
color int DEFAULT 1, color int DEFAULT 0,
hoist bool DEFAULT false, hoist bool DEFAULT false,
position int NOT NULL, position int NOT NULL,
permissions int NOT NULL, permissions int NOT NULL,