Skip to content

Commit cef11df

Browse files
committed
Revert "feat: New schema for reviews backend. | NPG-000 (#731)"
This reverts commit 54c4738.
1 parent 05f3bed commit cef11df

13 files changed

+68
-229
lines changed

docker/voting-node.dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ FROM jormungandr:latest as jorm
88

99
# stage 3
1010
FROM python as poetry
11-
RUN pip install poetry==2.0.1
11+
RUN pip install poetry==1.8.0
1212

1313
# Add python codebase
1414
COPY . /voting

services/voting-node/Earthfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ builder:
2121
zlib1g-dev
2222

2323
# Install Poetry
24-
RUN curl -sSL https://install.python-poetry.org | python3 - --version 2.0.1
24+
RUN curl -sSL https://install.python-poetry.org | python3 - --version 1.8.0
2525

2626
SAVE IMAGE --cache-hint
2727

@@ -42,7 +42,6 @@ deps:
4242
RUN poetry config installer.max-workers 10
4343
# Install package dependencies without the voting_node package
4444
RUN poetry install --only main --no-root
45-
RUN poetry self add poetry-plugin-export
4645

4746
# Copy the voting_node source code
4847
COPY --dir voting_node README.md ./

src/event-db/migrations/V11__reviews.sql

-106
This file was deleted.

src/event-db/migrations/V4__catalyst_id.sql

-45
This file was deleted.

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

+22-17
Original file line numberDiff line numberDiff line change
@@ -99,47 +99,52 @@ 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,
104+
reward_address TEXT,
105105

106+
-- These fields are deprecated and WILL BE removed in a future migration.
107+
-- They MUST only be used for Vit-SS compatibility.
106108
impact_alignment_rating_given INTEGER,
107109
impact_alignment_note VARCHAR,
108110
feasibility_rating_given INTEGER,
109111
feasibility_note VARCHAR,
110112
auditability_rating_given INTEGER,
111113
auditability_note VARCHAR,
112-
allocated INTEGER,
113114
ranking INTEGER,
114115
flags JSONB NULL,
115116

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
117+
FOREIGN KEY (proposal_id) REFERENCES proposal(row_id) ON DELETE CASCADE,
118+
FOREIGN KEY (assessor_level) REFERENCES reviewer_level(row_id) ON DELETE CASCADE
118119
);
119120

120121
COMMENT ON TABLE proposal_review IS 'All Reviews.';
121122
COMMENT ON COLUMN proposal_review.row_id IS 'Synthetic Unique Key.';
122-
COMMENT ON COLUMN proposal_review.proposal_id IS 'The Proposal id this review belongs to.';
123-
COMMENT ON COLUMN proposal_review.user_id IS 'The user id this review belongs to.';
124-
COMMENT ON COLUMN proposal_review.assessor IS 'Assessors Anonymized ID.';
123+
COMMENT ON COLUMN proposal_review.proposal_id IS 'The Proposal this review is for.';
124+
COMMENT ON COLUMN proposal_review.assessor IS 'Assessors Anonymized ID';
125125
COMMENT ON COLUMN proposal_review.assessor_level IS 'Assessors level ID';
126+
COMMENT ON COLUMN proposal_review.reward_address IS 'Assessors reward address';
126127

127128
COMMENT ON COLUMN proposal_review.impact_alignment_rating_given IS
128-
'The numeric rating assigned to the proposal by the assessor.';
129+
'The numeric rating assigned to the proposal by the assessor.
130+
DEPRECATED: Only used for Vit-SS compatibility.';
129131
COMMENT ON COLUMN proposal_review.impact_alignment_note IS
130-
'A note about why the impact rating was given.';
132+
'A note about why the impact rating was given.
133+
DEPRECATED: Only used for Vit-SS compatibility.';
134+
131135
COMMENT ON COLUMN proposal_review.feasibility_rating_given IS
132-
'The numeric feasibility rating given.';
136+
'The numeric feasibility rating given.
137+
DEPRECATED: Only used for Vit-SS compatibility.';
133138
COMMENT ON COLUMN proposal_review.feasibility_note IS
134-
'A note about why the feasibility rating was given.';
139+
'A note about why the feasibility rating was given.
140+
DEPRECATED: Only used for Vit-SS compatibility.';
141+
135142
COMMENT ON COLUMN proposal_review.auditability_rating_given IS
136-
'The numeric auditability rating given.';
143+
'The numeric auditability rating given.
144+
DEPRECATED: Only used for Vit-SS compatibility.';
137145
COMMENT ON COLUMN proposal_review.auditability_note IS
138-
'A note about the auditability rating given.';
139-
140-
COMMENT ON COLUMN proposal_review.allocated IS
141-
'Describes if the review was part of the original reviewer allocation.
142-
';
146+
'A note about the auditability rating given.
147+
DEPRECATED: Only used for Vit-SS compatibility.';
143148

144149
COMMENT ON COLUMN proposal_review.ranking IS
145150
'Numeric Measure of quality of this review according to veteran community advisors.

src/event-db/migrations/V5__user.sql

-53
This file was deleted.
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.';

utilities/fragment-exporter/Earthfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ deps:
1111
RUN apt-get update && \
1212
apt-get install -y --no-install-recommends curl
1313

14-
RUN curl -sSL https://install.python-poetry.org | python3 - --version 2.0.1
14+
RUN curl -sSL https://install.python-poetry.org | python3 - --version 1.8.0
1515

1616
COPY pyproject.toml .
1717
COPY poetry.lock .
1818

1919
RUN poetry install --only main --no-root
20-
RUN poetry self add poetry-plugin-export
2120

2221
src:
2322
FROM +deps

utilities/ideascale-importer/Earthfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ build:
1515
apt-get install -y --no-install-recommends curl build-essential libxml2-dev libxslt-dev zlib1g-dev python3-lxml
1616

1717
# Install Poetry
18-
RUN curl -sSL https://install.python-poetry.org | python3 - --version 2.0.1
19-
18+
RUN curl -sSL https://install.python-poetry.org | python3 - --version 1.8.0
2019
# Set path to poetry
2120
ENV PATH=/root/.local/bin:$PATH
2221

@@ -29,7 +28,6 @@ build:
2928
RUN poetry env use python
3029
RUN poetry config installer.max-workers 10
3130
RUN poetry install --no-cache --no-root
32-
RUN poetry self add poetry-plugin-export
3331

3432
# Build the distribution wheels and save them as artifacts
3533
RUN poetry export --without-hashes -f requirements.txt --output requirements.txt

0 commit comments

Comments
 (0)