feat: Add lb and adjust commands.

This commit is contained in:
2025-09-02 21:31:19 +10:00
parent a3a3b36230
commit b10098d28f
3 changed files with 197 additions and 82 deletions

View File

@@ -6,7 +6,7 @@ VALUES ('SUBATHON', 0, 1, 'Initial Creation');
CREATE TABLE subathons(
subathon_id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
communityid INTEGER NOT NULL REFERENCES communities(communityid),
communityid INTEGER NOT NULL REFERENCES communities(communityid) ON DELETE CASCADE ON UPDATE CASCADE,
started_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
initial_time INTEGER NOT NULL,
name TEXT,
@@ -27,8 +27,8 @@ CREATE TABLE running_subathons(
CREATE TABLE subathon_contributions(
contribution_id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
subathon_id INTEGER NOT NULL REFERENCES subathons(subathon_id),
profileid INTEGER REFERENCES user_profiles(profileid),
subathon_id INTEGER NOT NULL REFERENCES subathons(subathon_id) ON DELETE CASCADE,
profileid INTEGER REFERENCES user_profiles(profileid) ON DELETE SET NULL,
score NUMERIC NOT NULL,
event_id INTEGER REFERENCES events(event_id),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
@@ -36,7 +36,7 @@ CREATE TABLE subathon_contributions(
CREATE TABLE subathon_goals(
goal_id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
subathon_id INTEGER NOT NULL REFERENCES subathons(subathon_id),
subathon_id INTEGER NOT NULL REFERENCES subathons(subathon_id) ON DELETE CASCADE,
required_score NUMERIC NOT NULL,
description TEXT NOT NULL,
notified BOOLEAN DEFAULT false,