Store role list in database and convert role mentions into a readable format

This commit is contained in:
Tulir Asokan
2022-07-08 15:31:03 +03:00
parent 668a77e30d
commit 2611cbfa34
8 changed files with 246 additions and 9 deletions

View File

@@ -0,0 +1,19 @@
-- v7: Store role info
CREATE TABLE role (
dc_guild_id TEXT,
dcid TEXT,
name TEXT NOT NULL,
icon TEXT,
mentionable BOOLEAN NOT NULL,
managed BOOLEAN NOT NULL,
hoist BOOLEAN NOT NULL,
color INTEGER NOT NULL,
position INTEGER NOT NULL,
permissions BIGINT NOT NULL,
PRIMARY KEY (dc_guild_id, dcid),
CONSTRAINT role_guild_fkey FOREIGN KEY (dc_guild_id) REFERENCES guild (dcid) ON DELETE CASCADE
);