summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-08-03 09:47:34 +0200
committerYorhel <git@yorhel.nl>2020-08-07 12:36:58 +0200
commitd08487d61c540573eede594c36d07e25c9832a23 (patch)
tree853373112531be7774059ae7be7571c012854288 /util
parent403b2ddc47debe73eb857f12fe3acf8bb8347e7b (diff)
reviews: Add up/down voting on reviews
Diffstat (limited to 'util')
-rw-r--r--util/updates/wip-reviews.sql5
1 files changed, 3 insertions, 2 deletions
diff --git a/util/updates/wip-reviews.sql b/util/updates/wip-reviews.sql
index fbf588d3..c9699ab2 100644
--- a/util/updates/wip-reviews.sql
+++ b/util/updates/wip-reviews.sql
@@ -21,8 +21,9 @@ CREATE TABLE reviews_votes (
vote boolean NOT NULL -- true = upvote, false = downvote
);
-CREATE UNIQUE INDEX reviews_vid_uid ON reviews (vid,uid);
-CREATE INDEX reviews_uid ON reviews (uid);
+CREATE UNIQUE INDEX reviews_vid_uid ON reviews (vid,uid);
+CREATE INDEX reviews_uid ON reviews (uid);
+CREATE UNIQUE INDEX reviews_votes_id_uid ON reviews_votes (id,uid);
ALTER TABLE reviews ADD CONSTRAINT reviews_vid_fkey FOREIGN KEY (vid) REFERENCES vn (id) ON DELETE CASCADE;
ALTER TABLE reviews ADD CONSTRAINT reviews_uid_fkey FOREIGN KEY (uid) REFERENCES users (id) ON DELETE SET DEFAULT;