diff options
author | Yorhel <git@yorhel.nl> | 2021-07-29 18:40:11 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2021-07-30 11:25:27 +0200 |
commit | 45df2ef26b7df9d43093655f56e345d717a737a3 (patch) | |
tree | 0f94d359f92af64a88c279f6362a08e014871aba /util | |
parent | d2b959a3ca4169fa43f9f422c2b869c3bede08a0 (diff) |
Add early test implementation of VN length voting
There's no way to list or aggregate the votes yet, and I'm not fully
sure the data model is what it should be. Hence testing.
Diffstat (limited to 'util')
-rw-r--r-- | util/updates/2021-07-30-vn-length-voting.sql | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/util/updates/2021-07-30-vn-length-voting.sql b/util/updates/2021-07-30-vn-length-voting.sql new file mode 100644 index 00000000..48dedb52 --- /dev/null +++ b/util/updates/2021-07-30-vn-length-voting.sql @@ -0,0 +1,17 @@ +CREATE TABLE vn_length_votes ( + vid vndbid NOT NULL, + rid vndbid NOT NULL, + date timestamptz NOT NULL DEFAULT NOW(), + uid vndbid, + length smallint NOT NULL, -- minutes + notes text NOT NULL DEFAULT '' +); +ALTER TABLE vn_length_votes ADD CONSTRAINT vn_length_votes_vid_fkey FOREIGN KEY (vid) REFERENCES vn (id); +ALTER TABLE vn_length_votes ADD CONSTRAINT vn_length_votes_rid_fkey FOREIGN KEY (rid) REFERENCES releases (id); +ALTER TABLE vn_length_votes ADD CONSTRAINT vn_length_votes_uid_fkey FOREIGN KEY (uid) REFERENCES users (id) ON DELETE SET DEFAULT; +CREATE UNIQUE INDEX vn_length_votes_pkey ON vn_length_votes (vid, uid); + +-- DEFAULT false while it's in development. +ALTER TABLE users ADD COLUMN perm_lengthvote boolean NOT NULL DEFAULT false; + +\i sql/perms.sql |