55
66CREATE TABLE subscription
77(
8- row_id SERIAL PRIMARY KEY ,
9- user_id INTEGER NOT NULL ,
10- event_id INTEGER NOT NULL ,
11- role INTEGER NOT NULL ,
12- status INTEGER NOT NULL ,
13- extra JSONB NULL ,
8+ row_id SERIAL PRIMARY KEY ,
9+ user_id INTEGER NOT NULL ,
10+ event_id INTEGER NOT NULL ,
11+ role INTEGER NOT NULL ,
12+ status INTEGER NOT NULL ,
13+ extra JSONB NULL ,
1414
1515 FOREIGN KEY (user_id) REFERENCES catalyst_user(row_id) ON DELETE CASCADE ,
1616 FOREIGN KEY (event_id) REFERENCES event(row_id) ON DELETE CASCADE
@@ -27,6 +27,9 @@ Some of these subscriptions will be automatically created by the system.
2727The presence/status of subscriptions will determine user capabilities in the app.
2828' ;
2929
30+ COMMENT ON COLUMN subscription.user_id IS ' The user ID this subscription belongs to.' ;
31+ COMMENT ON COLUMN subscription.event_id IS ' The event ID this subscription belongs to.' ;
32+
3033COMMENT ON COLUMN subscription.role IS
3134' This field describes the role of the user for this subscription.
3235Possible values:
@@ -40,7 +43,8 @@ Specifically:
4043
4144anonymous_id: str,
4245subscription_date: datetime,
43- preferred_categories: [int]
46+ preferred_categories: [int],
47+ reward_address: str
4448' ;
4549
4650
@@ -51,11 +55,11 @@ preferred_categories: [int]
5155-- - the allocation of moderations that needs to be done.
5256
5357CREATE TABLE allocation (
54- row_id SERIAL PRIMARY KEY ,
58+ row_id SERIAL PRIMARY KEY ,
5559 proposal_id INTEGER NULL ,
56- review_id INTEGER NULL ,
57- user_id INTEGER NOT NULL ,
58- type INTEGER NOT NULL ,
60+ review_id INTEGER NULL ,
61+ user_id INTEGER NOT NULL ,
62+ type INTEGER NOT NULL ,
5963
6064 FOREIGN KEY (proposal_id) REFERENCES proposal(row_id) ON DELETE CASCADE ,
6165 FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE ,
@@ -65,9 +69,9 @@ CREATE TABLE allocation (
6569
6670COMMENT ON TABLE allocation IS ' The relationship between users and proposals or proposals_reviews.' ;
6771COMMENT ON COLUMN allocation.row_id IS ' Synthetic ID of this relationship.' ;
68- COMMENT ON COLUMN allocation.proposal_id IS ' The proposal the relationship is related to.' ;
69- COMMENT ON COLUMN allocation.review_id IS ' The review the relationship is related to.' ;
70- COMMENT ON COLUMN allocation.user_id IS ' The user the relationship is related to.' ;
72+ COMMENT ON COLUMN allocation.proposal_id IS ' The proposal ID the relationship belongs to.' ;
73+ COMMENT ON COLUMN allocation.review_id IS ' The review ID the relationship belongs to.' ;
74+ COMMENT ON COLUMN allocation.user_id IS ' The user ID the relationship belongs to.' ;
7175COMMENT ON COLUMN allocation.type IS ' The type of relationship stored.
7276Possible values:
73770: proposal ownership relation. proposal_id and user_id are required
@@ -82,11 +86,11 @@ CREATE INDEX idx_allocation_user_type ON allocation(user_id, type);
8286-- Moderation - Defines the moderation submitted by users for each proposal_review.
8387
8488CREATE TABLE moderation (
85- row_id SERIAL PRIMARY KEY ,
86- review_id INTEGER NOT NULL ,
87- user_id INTEGER NOT NULL ,
88- classification INTEGER NOT NULL ,
89- rationale VARCHAR ,
89+ row_id SERIAL PRIMARY KEY ,
90+ review_id INTEGER NOT NULL ,
91+ user_id INTEGER NOT NULL ,
92+ classification INTEGER NOT NULL ,
93+ rationale VARCHAR ,
9094 UNIQUE (review_id, user_id),
9195
9296 FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE ,
@@ -96,7 +100,7 @@ CREATE TABLE moderation (
96100
97101COMMENT ON TABLE moderation IS ' An individual moderation for a proposal review.' ;
98102COMMENT ON COLUMN moderation.row_id IS ' Synthetic ID of this moderation.' ;
99- COMMENT ON COLUMN moderation.review_id IS ' The review the moderation is related to.' ;
100- COMMENT ON COLUMN moderation.user_id IS ' The user the moderation is submitted from .' ;
103+ COMMENT ON COLUMN moderation.review_id IS ' The review ID the moderation belongs to.' ;
104+ COMMENT ON COLUMN moderation.user_id IS ' The user ID the moderation belongs to .' ;
101105COMMENT ON COLUMN moderation.classification IS ' The value used to describe the moderation (e.g. 0: excluded, 1: included).' ;
102106COMMENT ON COLUMN moderation.rationale IS ' The rationale for the given classification.' ;
0 commit comments