From 8c9e2e6cd8b340ce40c0b7c85397190bb851f5af Mon Sep 17 00:00:00 2001 From: Conatum Date: Thu, 12 May 2022 00:22:27 +0300 Subject: [PATCH] (data): Implement guild contribution log. --- data/schema.sql | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/data/schema.sql b/data/schema.sql index c96908b8..67dcd197 100644 --- a/data/schema.sql +++ b/data/schema.sql @@ -910,13 +910,19 @@ CREATE VIEW user_active_skins AS -- Premium Guild Data {{{ CREATE TABLE premium_guilds( guildid BIGINT PRIMARY KEY REFERENCES guild_config, - premium_since TIMESTAMPTZ NOT NULL, - premium_until TIMESTAMPTZ NOT NULL, + premium_since TIMESTAMPTZ NOT NULL DEFAULT now(), + premium_until TIMESTAMPTZ NOT NULL DEFAULT now(), custom_skin_id INTEGER REFERENCES customised_skins ); -- Contributions members have made to guild premium funds CREATE TABLE premium_guild_contributions( + contributionid SERIAL PRIMARY KEY, + userid BIGINT NOT NULL REFERENCES user_config, + guildid BIGINT NOT NULL REFERENCES premium_guilds, + transactionid INTEGER REFERENCES gem_transactions, + duration INTEGER NOT NULL, + _timestamp TIMESTAMPTZ DEFAULT now() ); -- }}}