diff options
author | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-08-27 11:05:59 +0000 |
---|---|---|
committer | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-08-27 11:05:59 +0000 |
commit | ba035329e131ab342fe3c873f98b01b1c383b248 (patch) | |
tree | 875a7ebe64509c4183adb93cfe7cb551d1452edd /util | |
parent | 5d04638c123a8d2e34c4c56d3e90ecd6e6749117 (diff) |
Added release link to screenshots
git-svn-id: svn://vndb.org/vndb@103 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'util')
-rw-r--r-- | util/dump.sql | 2 | ||||
-rw-r--r-- | util/updates/update_1.22.sql | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/util/dump.sql b/util/dump.sql index cedd2518..39e74bad 100644 --- a/util/dump.sql +++ b/util/dump.sql @@ -233,6 +233,7 @@ CREATE TABLE vn_screenshots ( vid integer NOT NULL DEFAULT 0, scr integer NOT NULL DEFAULT 0, nsfw boolean NOT NULL DEFAULT FALSE, + rid integer DEFAULT NULL, PRIMARY KEY(vid, scr) ); @@ -305,6 +306,7 @@ ALTER TABLE vn_rev ADD FOREIGN KEY (id) REFERENCES changes ALTER TABLE vn_rev ADD FOREIGN KEY (vid) REFERENCES vn (id) DEFERRABLE INITIALLY DEFERRED; ALTER TABLE vn_screenshots ADD FOREIGN KEY (vid) REFERENCES vn_rev (id) DEFERRABLE INITIALLY DEFERRED; ALTER TABLE vn_screenshots ADD FOREIGN KEY (scr) REFERENCES screenshots (id) DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE vn_screenshots ADD FOREIGN KEY (rid) REFERENCES releases (id) DEFERRABLE INITIALLY DEFERRED; ALTER TABLE vnlists ADD FOREIGN KEY (uid) REFERENCES users (id) DEFERRABLE INITIALLY DEFERRED; ALTER TABLE vnlists ADD FOREIGN KEY (vid) REFERENCES vn (id) DEFERRABLE INITIALLY DEFERRED; ALTER TABLE votes ADD FOREIGN KEY (uid) REFERENCES users (id) DEFERRABLE INITIALLY DEFERRED; diff --git a/util/updates/update_1.22.sql b/util/updates/update_1.22.sql index 9a81b2c6..897b0a2b 100644 --- a/util/updates/update_1.22.sql +++ b/util/updates/update_1.22.sql @@ -27,3 +27,8 @@ ALTER TABLE changes ADD FOREIGN KEY (causedby) REFERENCES changes (id) DEFERRABL ALTER TABLE threads_posts ALTER COLUMN num TYPE smallint; ALTER TABLE threads ADD FOREIGN KEY (id, count) REFERENCES threads_posts (tid, num) DEFERRABLE INITIALLY DEFERRED; + +-- screenshots now have a relation with releases +ALTER TABLE vn_screenshots ADD COLUMN rid integer DEFAULT NULL REFERENCES releases (id) DEFERRABLE INITIALLY DEFERRED; + + |