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