summaryrefslogtreecommitdiff
path: root/util/dump.sql
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-10-21 14:21:38 +0200
committerYorhel <git@yorhel.nl>2009-10-21 14:24:10 +0200
commit96e77619793fbe8351e023d17e257e96cdb37509 (patch)
tree6d501f042ffeb7b0dd852a9430aeb5690548c5c1 /util/dump.sql
parent0325073d1eb045628f6090c7be4ee9685d7ec159 (diff)
SQL: Renamed vn_graphs to relgraphs and synced dbgraph.pl
As the same table can easily be used to store producer relation graphs as well.
Diffstat (limited to 'util/dump.sql')
-rw-r--r--util/dump.sql18
1 files changed, 7 insertions, 11 deletions
diff --git a/util/dump.sql b/util/dump.sql
index f5ce2614..97d317e0 100644
--- a/util/dump.sql
+++ b/util/dump.sql
@@ -50,7 +50,6 @@ CREATE TABLE producers (
hidden boolean NOT NULL DEFAULT FALSE
);
-
-- producers_relations
CREATE TABLE producers_relations (
pid1 integer NOT NULL,
@@ -59,7 +58,6 @@ CREATE TABLE producers_relations (
PRIMARY KEY(pid1, pid2)
);
-
-- producers_rev
CREATE TABLE producers_rev (
id integer NOT NULL PRIMARY KEY,
@@ -73,7 +71,6 @@ CREATE TABLE producers_rev (
alias varchar(500) NOT NULL DEFAULT ''
);
-
-- quotes
CREATE TABLE quotes (
vid integer NOT NULL,
@@ -81,7 +78,6 @@ CREATE TABLE quotes (
PRIMARY KEY(vid, quote)
);
-
-- releases
CREATE TABLE releases (
id SERIAL NOT NULL PRIMARY KEY,
@@ -151,6 +147,12 @@ CREATE TABLE releases_vn (
PRIMARY KEY(rid, vid)
);
+-- relgraphs
+CREATE TABLE relgraphs (
+ id SERIAL PRIMARY KEY,
+ svg xml NOT NULL
+);
+
-- rlists
CREATE TABLE rlists (
uid integer NOT NULL DEFAULT 0,
@@ -297,12 +299,6 @@ CREATE TABLE vn_anime (
PRIMARY KEY(vid, aid)
);
--- vn_graphs
-CREATE TABLE vn_graphs (
- id SERIAL PRIMARY KEY,
- svg xml NOT NULL
-);
-
-- vn_relations
CREATE TABLE vn_relations (
vid1 integer NOT NULL DEFAULT 0,
@@ -397,7 +393,7 @@ ALTER TABLE threads_posts ADD FOREIGN KEY (tid) REFERENCES threads
ALTER TABLE threads_posts ADD FOREIGN KEY (uid) REFERENCES users (id);
ALTER TABLE threads_boards ADD FOREIGN KEY (tid) REFERENCES threads (id);
ALTER TABLE vn ADD FOREIGN KEY (latest) REFERENCES vn_rev (id) DEFERRABLE INITIALLY DEFERRED;
-ALTER TABLE vn ADD FOREIGN KEY (rgraph) REFERENCES vn_graphs (id);
+ALTER TABLE vn ADD FOREIGN KEY (rgraph) REFERENCES relgraphs (id);
ALTER TABLE vn_anime ADD FOREIGN KEY (aid) REFERENCES anime (id);
ALTER TABLE vn_anime ADD FOREIGN KEY (vid) REFERENCES vn_rev (id);
ALTER TABLE vn_relations ADD FOREIGN KEY (vid1) REFERENCES vn_rev (id);