summaryrefslogtreecommitdiff
path: root/util/updates
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-12-30 09:29:03 +0100
committerYorhel <git@yorhel.nl>2019-12-30 09:29:03 +0100
commite146ed7bda12d369532e485ca0c2e3d823811854 (patch)
treef5e86b31f0255c89397fcb201af5c38a62bc9d4b /util/updates
parent40ef00116cc12aef4ce08fc1136e329c58abda4b (diff)
ulist: Remove remnants of old votes/vnlists/wlists tables
Diffstat (limited to 'util/updates')
-rw-r--r--util/updates/update_wip_lists.sql10
1 files changed, 7 insertions, 3 deletions
diff --git a/util/updates/update_wip_lists.sql b/util/updates/update_wip_lists.sql
index c07e4ba1..0ff7a452 100644
--- a/util/updates/update_wip_lists.sql
+++ b/util/updates/update_wip_lists.sql
@@ -115,6 +115,9 @@ COMMIT;
DROP FUNCTION update_vnpopularity();
+ALTER TABLE users ADD COLUMN c_vns integer NOT NULL DEFAULT 0;
+ALTER TABLE users ADD COLUMN c_wish integer NOT NULL DEFAULT 0;
+
\i util/sql/func.sql
\i util/sql/perms.sql
@@ -124,10 +127,11 @@ CREATE TRIGGER ulist_labels_create AFTER INSERT ON users FOR EACH ROW EXECUTE PR
CREATE TRIGGER ulist_voted_label AFTER INSERT OR UPDATE ON ulist_vns FOR EACH ROW EXECUTE PROCEDURE ulist_voted_label();
CREATE CONSTRAINT TRIGGER update_vnlist_rlist AFTER DELETE ON ulist_vns DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE update_vnlist_rlist();
-ALTER TABLE users ADD COLUMN c_vns integer NOT NULL DEFAULT 0;
-ALTER TABLE users ADD COLUMN c_wish integer NOT NULL DEFAULT 0;
-
\timing
SELECT update_users_ulist_stats(NULL);
CREATE INDEX ulist_vns_voted ON ulist_vns (vid, vote_date) WHERE vote IS NOT NULL;
CREATE INDEX users_ign_votes ON users (id) WHERE ign_votes;
+
+
+-- Can be done later:
+-- DROP TABLE wlists, vnlists, votes;