summaryrefslogtreecommitdiff
path: root/util/dump.sql
diff options
context:
space:
mode:
authoryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-08-14 15:19:18 +0000
committeryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-08-14 15:19:18 +0000
commit889e9b9c481170c94f0b5e773e7c39d27b921a43 (patch)
tree7515e85ee690916f7549fd27bd0a2879657d913b /util/dump.sql
parent99214c46848b3e4706552cfb87043861c1b5f140 (diff)
Added screenshots (not entirely finished, still needs some tweaking and polishing)
git-svn-id: svn://vndb.org/vndb@83 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'util/dump.sql')
-rw-r--r--util/dump.sql12
1 files changed, 11 insertions, 1 deletions
diff --git a/util/dump.sql b/util/dump.sql
index 884c06e8..f2db8bc2 100644
--- a/util/dump.sql
+++ b/util/dump.sql
@@ -214,6 +214,14 @@ CREATE TABLE vn_rev (
l_renai varchar(100) NOT NULL DEFAULT ''
);
+-- vn_screenshots
+CREATE TABLE vn_screenshots (
+ vid integer NOT NULL DEFAULT 0,
+ scr integer NOT NULL DEFAULT 0,
+ nsfw smallint NOT NULL DEFAULT 0,
+ PRIMARY KEY(vid, scr)
+);
+
-- vnlists
CREATE TABLE vnlists (
uid integer DEFAULT 0,
@@ -278,6 +286,7 @@ ALTER TABLE vn_relations ADD FOREIGN KEY (vid1) REFERENCES vn_rev
ALTER TABLE vn_relations ADD FOREIGN KEY (vid2) REFERENCES vn (id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE vn_rev ADD FOREIGN KEY (id) REFERENCES changes (id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE vn_rev ADD FOREIGN KEY (vid) REFERENCES vn (id) DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE vn_screenshots ADD FOREIGN KEY (vid) REFERENCES vn (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;
@@ -379,9 +388,10 @@ $$ LANGUAGE plpgsql;
---------------------------------
--- Two sequences used for cover and relation graph ID numbers
+-- Sequences used for cover, relation graph and screenshot ID numbers
CREATE SEQUENCE covers_seq;
CREATE SEQUENCE relgraph_seq;
+CREATE SEQUENCE screenshots_seq;
INSERT INTO users (id, username, mail, rank)
VALUES (0, 'deleted', 'del@vndb.org', 0);