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,9 +27,6 @@ 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-
3330COMMENT ON COLUMN subscription.role IS
3431' This field describes the role of the user for this subscription.
3532Possible values:
@@ -43,8 +40,7 @@ Specifically:
4340
4441anonymous_id: str,
4542subscription_date: datetime,
46- preferred_categories: [int],
47- reward_address: str
43+ preferred_categories: [int]
4844' ;
4945
5046
@@ -55,11 +51,11 @@ reward_address: str
5551-- - the allocation of moderations that needs to be done.
5652
5753CREATE TABLE allocation (
58- row_id SERIAL PRIMARY KEY ,
54+ row_id SERIAL PRIMARY KEY ,
5955 proposal_id INTEGER NULL ,
60- review_id INTEGER NULL ,
61- user_id INTEGER NOT NULL ,
62- type INTEGER NOT NULL ,
56+ review_id INTEGER NULL ,
57+ user_id INTEGER NOT NULL ,
58+ type INTEGER NOT NULL ,
6359
6460 FOREIGN KEY (proposal_id) REFERENCES proposal(row_id) ON DELETE CASCADE ,
6561 FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE ,
@@ -69,9 +65,9 @@ CREATE TABLE allocation (
6965
7066COMMENT ON TABLE allocation IS ' The relationship between users and proposals or proposals_reviews.' ;
7167COMMENT ON COLUMN allocation.row_id IS ' Synthetic ID of this relationship.' ;
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.' ;
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.' ;
7571COMMENT ON COLUMN allocation.type IS ' The type of relationship stored.
7672Possible values:
77730: proposal ownership relation. proposal_id and user_id are required
@@ -86,11 +82,11 @@ CREATE INDEX idx_allocation_user_type ON allocation(user_id, type);
8682-- Moderation - Defines the moderation submitted by users for each proposal_review.
8783
8884CREATE TABLE moderation (
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 ,
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 ,
9490 UNIQUE (review_id, user_id),
9591
9692 FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE ,
@@ -100,7 +96,7 @@ CREATE TABLE moderation (
10096
10197COMMENT ON TABLE moderation IS ' An individual moderation for a proposal review.' ;
10298COMMENT ON COLUMN moderation.row_id IS ' Synthetic ID of this moderation.' ;
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 .' ;
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 .' ;
105101COMMENT ON COLUMN moderation.classification IS ' The value used to describe the moderation (e.g. 0: excluded, 1: included).' ;
106102COMMENT ON COLUMN moderation.rationale IS ' The rationale for the given classification.' ;
0 commit comments