Skip to content

Commit 0fb01f9

Browse files
committed
revert commit
1 parent 68c1d6a commit 0fb01f9

File tree

6 files changed

+44
-8
lines changed

6 files changed

+44
-8
lines changed

src/event-db/migrations/V6__proposal_tables.sql renamed to src/event-db/migrations/V4__proposal_tables.sql

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ COMMENT ON COLUMN reviewer_level.event_id IS 'The specific Event ID this review
9999
CREATE TABLE proposal_review (
100100
row_id SERIAL PRIMARY KEY,
101101
proposal_id INTEGER NOT NULL,
102-
user_id INTEGER NOT NULL,
103102
assessor VARCHAR NOT NULL,
104103
assessor_level INTEGER,
105104

@@ -109,12 +108,11 @@ CREATE TABLE proposal_review (
109108
feasibility_note VARCHAR,
110109
auditability_rating_given INTEGER,
111110
auditability_note VARCHAR,
112-
allocated INTEGER,
113111
ranking INTEGER,
114112
flags JSONB NULL,
115113

116-
FOREIGN KEY (user_id) REFERENCES catalyst_user(row_id) ON DELETE SET NULL,
117-
FOREIGN KEY (proposal_id) REFERENCES proposal(row_id) ON DELETE CASCADE
114+
FOREIGN KEY (proposal_id) REFERENCES proposal(row_id) ON DELETE CASCADE,
115+
FOREIGN KEY (assessor_level) REFERENCES reviewer_level(row_id) ON DELETE CASCADE
118116
);
119117

120118
COMMENT ON TABLE proposal_review IS 'All Reviews.';
@@ -137,10 +135,6 @@ COMMENT ON COLUMN proposal_review.auditability_rating_given IS
137135
COMMENT ON COLUMN proposal_review.auditability_note IS
138136
'A note about the auditability rating given.';
139137

140-
COMMENT ON COLUMN proposal_review.allocated IS
141-
'Describes if the review was part of the original reviewer allocation.
142-
';
143-
144138
COMMENT ON COLUMN proposal_review.ranking IS
145139
'Numeric Measure of quality of this review according to veteran community advisors.
146140
DEPRECATED: Only used for Vit-SS compatibility.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
-- Catalyst Event Database
2+
3+
-- ModerationAllocation - Defines the relationship between users and proposals_reviews
4+
-- to describe the allocation of moderations that needs to be done.
5+
6+
CREATE TABLE moderation_allocation (
7+
row_id SERIAL PRIMARY KEY,
8+
review_id INTEGER NOT NULL,
9+
user_id INTEGER NOT NULL,
10+
11+
FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE,
12+
FOREIGN KEY (user_id) REFERENCES config(row_id) ON DELETE CASCADE
13+
);
14+
15+
16+
COMMENT ON TABLE moderation_allocation IS 'The relationship between users and proposals_reviews.';
17+
COMMENT ON COLUMN moderation_allocation.row_id IS 'Synthetic ID of this relationship.';
18+
COMMENT ON COLUMN moderation_allocation.review_id IS 'The review the relationship is related to.';
19+
COMMENT ON COLUMN moderation_allocation.user_id IS 'The user the relationship is related to.';
20+
21+
22+
-- Moderation - Defines the moderation submitted by users for each proposal_review.
23+
24+
CREATE TABLE moderation (
25+
row_id SERIAL PRIMARY KEY,
26+
review_id INTEGER NOT NULL,
27+
user_id INTEGER NOT NULL,
28+
classification INTEGER NOT NULL,
29+
rationale VARCHAR,
30+
UNIQUE (review_id, user_id),
31+
32+
FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE,
33+
FOREIGN KEY (user_id) REFERENCES config(row_id) ON DELETE CASCADE
34+
);
35+
36+
37+
COMMENT ON TABLE moderation IS 'An individual moderation for a proposal review.';
38+
COMMENT ON COLUMN moderation.row_id IS 'Synthetic ID of this moderation.';
39+
COMMENT ON COLUMN moderation.review_id IS 'The review the moderation is related to.';
40+
COMMENT ON COLUMN moderation.user_id IS 'The user the moderation is submitted from.';
41+
COMMENT ON COLUMN moderation.classification IS 'The value used to describe the moderation (e.g. 0: excluded, 1: included).';
42+
COMMENT ON COLUMN moderation.rationale IS 'The rationale for the given classification.';

0 commit comments

Comments
 (0)