5
5
6
6
CREATE TABLE subscription
7
7
(
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 ,
14
14
15
15
FOREIGN KEY (user_id) REFERENCES catalyst_user(row_id) ON DELETE CASCADE ,
16
16
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.
27
27
The presence/status of subscriptions will determine user capabilities in the app.
28
28
' ;
29
29
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
-
33
30
COMMENT ON COLUMN subscription.role IS
34
31
' This field describes the role of the user for this subscription.
35
32
Possible values:
@@ -43,8 +40,7 @@ Specifically:
43
40
44
41
anonymous_id: str,
45
42
subscription_date: datetime,
46
- preferred_categories: [int],
47
- reward_address: str
43
+ preferred_categories: [int]
48
44
' ;
49
45
50
46
@@ -55,11 +51,11 @@ reward_address: str
55
51
-- - the allocation of moderations that needs to be done.
56
52
57
53
CREATE TABLE allocation (
58
- row_id SERIAL PRIMARY KEY ,
54
+ row_id SERIAL PRIMARY KEY ,
59
55
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 ,
63
59
64
60
FOREIGN KEY (proposal_id) REFERENCES proposal(row_id) ON DELETE CASCADE ,
65
61
FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE ,
@@ -69,9 +65,9 @@ CREATE TABLE allocation (
69
65
70
66
COMMENT ON TABLE allocation IS ' The relationship between users and proposals or proposals_reviews.' ;
71
67
COMMENT 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.' ;
75
71
COMMENT ON COLUMN allocation.type IS ' The type of relationship stored.
76
72
Possible values:
77
73
0: 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);
86
82
-- Moderation - Defines the moderation submitted by users for each proposal_review.
87
83
88
84
CREATE 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 ,
94
90
UNIQUE (review_id, user_id),
95
91
96
92
FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE ,
@@ -100,7 +96,7 @@ CREATE TABLE moderation (
100
96
101
97
COMMENT ON TABLE moderation IS ' An individual moderation for a proposal review.' ;
102
98
COMMENT 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 .' ;
105
101
COMMENT ON COLUMN moderation.classification IS ' The value used to describe the moderation (e.g. 0: excluded, 1: included).' ;
106
102
COMMENT ON COLUMN moderation.rationale IS ' The rationale for the given classification.' ;
0 commit comments