(guild admin): Autoroles and role persistence.

This commit is contained in:
2021-10-05 00:28:33 +03:00
parent 4a34814a3b
commit 8b6f60d7f3
8 changed files with 273 additions and 8 deletions

View File

@@ -2,8 +2,30 @@ ALTER TABLE guild_config
ADD COLUMN greeting_channel BIGINT,
ADD COLUMN greeting_message TEXT,
ADD COLUMN returning_message TEXT,
ADD COLUMN starting_funds INTEGER;
ADD COLUMN starting_funds INTEGER,
ADD COLUMN persist_roles BOOLEAN;
CREATE INDEX rented_members_users ON rented_members (userid);
CREATE TABLE autoroles(
guildid BIGINT NOT NULL ,
roleid BIGINT NOT NULL
);
CREATE INDEX autoroles_guilds ON autoroles (guildid);
CREATE TABLE bot_autoroles(
guildid BIGINT NOT NULL ,
roleid BIGINT NOT NULL
);
CREATE INDEX bot_autoroles_guilds ON bot_autoroles (guildid);
CREATE TABLE past_member_roles(
guildid BIGINT NOT NULL,
userid BIGINT NOT NULL,
roleid BIGINT NOT NULL,
_timestamp TIMESTAMPTZ DEFAULT now(),
FOREIGN KEY (guildid, userid) REFERENCES members (guildid, userid)
);
CREATE INDEX member_role_persistence_members ON past_member_roles (guildid, userid);
INSERT INTO VersionHistory (version, author) VALUES (4, 'v3-v4 Migration');