summaryrefslogtreecommitdiff
path: root/util/sql/tableattrs.sql
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-11-11 15:51:40 +0100
committerYorhel <git@yorhel.nl>2015-11-11 16:00:34 +0100
commit1e97c0405a0cacb05d9d70429d7e7969e231b786 (patch)
tree1d31d74761726bf29868d1d0aebc66e188180dd9 /util/sql/tableattrs.sql
parentfd9f224ad7e1d6ebe4f7abba75526b5190c963ba (diff)
Misc poll improvements
- Merged polls table into threads table. Not much of a storage/performance difference, and it's a bit simpler this way. - Merged DB::Polls into DB::Discussions. Mainly because of the above change in DB structure. - Add option to remove an existing poll. - Allow preview and recast to be changed without deleting the votes - Set preview option by default. Because personal preferences. :) - Minor form validation differences
Diffstat (limited to 'util/sql/tableattrs.sql')
-rw-r--r--util/sql/tableattrs.sql4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/sql/tableattrs.sql b/util/sql/tableattrs.sql
index 7a144e1f..55f91742 100644
--- a/util/sql/tableattrs.sql
+++ b/util/sql/tableattrs.sql
@@ -51,6 +51,10 @@ ALTER TABLE tags_vn ADD CONSTRAINT tags_vn_tag_fkey
ALTER TABLE tags_vn ADD CONSTRAINT tags_vn_vid_fkey FOREIGN KEY (vid) REFERENCES vn (id);
ALTER TABLE tags_vn ADD CONSTRAINT tags_vn_uid_fkey FOREIGN KEY (uid) REFERENCES users (id) ON DELETE CASCADE;
ALTER TABLE threads ADD CONSTRAINT threads_id_fkey FOREIGN KEY (id, count) REFERENCES threads_posts (tid, num) DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE threads_poll_options ADD CONSTRAINT threads_poll_options_tid_fkey FOREIGN KEY (tid) REFERENCES threads (id) ON DELETE CASCADE;
+ALTER TABLE threads_poll_votes ADD CONSTRAINT threads_poll_votes_tid_fkey FOREIGN KEY (tid) REFERENCES threads (id) ON DELETE CASCADE;
+ALTER TABLE threads_poll_votes ADD CONSTRAINT threads_poll_votes_uid_fkey FOREIGN KEY (uid) REFERENCES users (id) ON DELETE CASCADE;
+ALTER TABLE threads_poll_votes ADD CONSTRAINT threads_poll_votes_optid_fkey FOREIGN KEY (optid) REFERENCES threads_poll_options (id) ON DELETE CASCADE;
ALTER TABLE threads_posts ADD CONSTRAINT threads_posts_tid_fkey FOREIGN KEY (tid) REFERENCES threads (id);
ALTER TABLE threads_posts ADD CONSTRAINT threads_posts_uid_fkey FOREIGN KEY (uid) REFERENCES users (id) ON DELETE SET DEFAULT;
ALTER TABLE threads_boards ADD CONSTRAINT threads_boards_tid_fkey FOREIGN KEY (tid) REFERENCES threads (id);