(Sysadmin): Add guild and user blacklist.

v2 -> v3 data migration for the blacklist tables.
Added blacklists and blacklist commands
Added bot admin level to help groups.
This commit is contained in:
2021-09-28 20:54:22 +03:00
parent b792b081b8
commit 9ae0de034f
14 changed files with 414 additions and 12 deletions

View File

@@ -4,7 +4,7 @@ CREATE TABLE VersionHistory(
time TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL,
author TEXT
);
INSERT INTO VersionHistory (version, author) VALUES (2, 'Initial Creation');
INSERT INTO VersionHistory (version, author) VALUES (3, 'Initial Creation');
CREATE OR REPLACE FUNCTION update_timestamp_column()
@@ -21,6 +21,20 @@ CREATE TABLE AppData(
appid TEXT PRIMARY KEY,
last_study_badge_scan TIMESTAMP
);
CREATE TABLE global_user_blacklist(
userid BIGINT PRIMARY KEY,
ownerid BIGINT NOT NULL,
reason TEXT NOT NULL,
created_at TIMESTAMPTZ DEFAULT now()
);
CREATE TABLE global_guild_blacklist(
guildid BIGINT PRIMARY KEY,
ownerid BIGINT NOT NULL,
reason TEXT NOT NULL,
created_at TIMESTAMPTZ DEFAULT now()
);
-- }}}
@@ -61,6 +75,12 @@ CREATE TABLE guild_config(
video_grace_period INTEGER
);
CREATE TABLE ignored_members(
guildid BIGINT NOT NULL,
userid BIGINT NOT NULL
);
CREATE INDEX ignored_member_guilds ON ignored_members (guildid);
CREATE TABLE unranked_roles(
guildid BIGINT NOT NULL,
roleid BIGINT NOT NULL