summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2022-08-30 10:42:09 +0200
committerYorhel <git@yorhel.nl>2022-08-30 10:42:09 +0200
commit34fabe3ebeb17119aac578bcb224fd9c74fb93ea (patch)
tree7551db74b71973577496e50d8d293c0ba8487122 /util
parentfcab0435c90414b60566b3d8c424a0263d0ce0e4 (diff)
Rename users_prefs_tags.tag -> tid, add update script
Diffstat (limited to 'util')
-rw-r--r--util/updates/wip-tag-prefs.sql12
1 files changed, 12 insertions, 0 deletions
diff --git a/util/updates/wip-tag-prefs.sql b/util/updates/wip-tag-prefs.sql
new file mode 100644
index 00000000..c5ee7312
--- /dev/null
+++ b/util/updates/wip-tag-prefs.sql
@@ -0,0 +1,12 @@
+CREATE TABLE users_prefs_tags (
+ id vndbid NOT NULL,
+ tid vndbid NOT NULL,
+ spoil smallint NOT NULL,
+ childs boolean NOT NULL,
+ PRIMARY KEY(id, tid)
+);
+
+ALTER TABLE users_prefs_tags ADD CONSTRAINT users_prefs_tags_id_fkey FOREIGN KEY (id) REFERENCES users (id) ON DELETE CASCADE;
+ALTER TABLE users_prefs_tags ADD CONSTRAINT users_prefs_tags_tid_fkey FOREIGN KEY (tid) REFERENCES tags (id) ON DELETE CASCADE;
+
+\i sql/perms.sql