data: Add webhook logging and modrole

This commit is contained in:
2026-07-29 15:46:13 +03:00
parent bc231da61f
commit d7447fc300
2 changed files with 12 additions and 2 deletions
+5 -1
View File
@@ -7,7 +7,7 @@ DO $$
$$ LANGUAGE plpgsql;
-- Plugin version history
INSERT INTO version_history (component, from_version, to_version, author) VALUES ('PLUSCAMPAIGN', 0, 1, 'Initial Creation');
INSERT INTO version_history (component, from_version, to_version, author) VALUES ('REWARDCAMPAIGN', 0, 1, 'Initial Creation');
CREATE TABLE campaigns(
@@ -15,6 +15,8 @@ CREATE TABLE campaigns(
communityid INTEGER NOT NULL REFERENCES communities(communityid) ON DELETE CASCADE ON UPDATE CASCADE,
target_rewards INTEGER,
campaign_name TEXT NOT NULL,
moderator_role_id BIGINT,
logging_webhook_url TEXT,
started_at TIMESTAMPTZ,
completed_at TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
@@ -33,6 +35,8 @@ CREATE TABLE campaign_rewards_earned(
fulfilled_at TIMESTAMPTZ,
fulfilled_note TEXT,
modnote TEXT,
reference TEXT,
logged_messageid BIGINT,
earned_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
earned_reason TEXT NOT NULL,
_timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW()
+7 -1
View File
@@ -13,6 +13,9 @@ class Campaign(RowModel):
started_at = Timestamp()
completed_at = Timestamp()
moderator_role_id = Integer()
logging_webhook_url = String()
created_at = Timestamp()
_timestamp = Timestamp()
@@ -34,13 +37,16 @@ class EarnedReward(RowModel):
earned_at = Timestamp()
earned_from = String()
modnote = String()
reference = String()
log_messageid = Integer()
_timestamp = Timestamp()
class CampaignData(Registry):
VERSION = ("CAMPAIGN", 1)
VERSION = ("REWARDCAMPAIGN", 1)
Campaign = Campaign
campaigns = Campaign.table