[DB] Init Topgg DB Framework

This commit is contained in:
Harsha Raghu
2022-01-14 18:49:51 +05:30
parent 3e0c1be33e
commit a2fcdf075f
2 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
from data import RowTable, Table
topggvotes = RowTable(
'topgg',
('voteid', 'userid', 'boostedTimestamp'),
'voteid'
)

View File

@@ -144,6 +144,15 @@ CREATE TABLE tasklist(
); );
CREATE INDEX tasklist_users ON tasklist (userid); CREATE INDEX tasklist_users ON tasklist (userid);
-- Topgg Data {{{
create TABLE topgg(
voteid SERIAL PRIMARY KEY,
userid BIGINT NOT NULL,
boostedTimestamp TIMESTAMPTZ NOT NULL
);
CREATE INDEX topgg_member ON topgg (guildid, userid);
-- }}}
CREATE TABLE tasklist_channels( CREATE TABLE tasklist_channels(
guildid BIGINT NOT NULL, guildid BIGINT NOT NULL,
channelid BIGINT NOT NULL channelid BIGINT NOT NULL