summaryrefslogtreecommitdiff
path: root/util/updates
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2011-02-22 16:30:19 +0100
committerYorhel <git@yorhel.nl>2011-02-22 16:30:19 +0100
commit77f6ce0bb06e0496fbcc98656b82108d62c6aeef (patch)
treea58aa39cb5b30899692ecc623d23182dabac0726 /util/updates
parent1c74dfdf44f080bc4a30be6303bf2845c2f5f7b0 (diff)
chardb: +char<->vn linking, +vn display on char pages
Diffstat (limited to 'util/updates')
-rw-r--r--util/updates/update_2.19.sql9
1 files changed, 5 insertions, 4 deletions
diff --git a/util/updates/update_2.19.sql b/util/updates/update_2.19.sql
index c8fb1119..bc1b5afe 100644
--- a/util/updates/update_2.19.sql
+++ b/util/updates/update_2.19.sql
@@ -73,11 +73,12 @@ CREATE TABLE chars_traits (
CREATE TABLE chars_vns (
cid integer NOT NULL REFERENCES chars_rev (id),
vid integer NOT NULL REFERENCES vn (id),
- rid integer REFERENCES releases (id),
- spoil boolean NOT NULL DEFAULT false,
- role char_role NOT NULL DEFAULT 'main',
- PRIMARY KEY(cid, vid, rid)
+ rid integer NULL REFERENCES releases (id),
+ spoil smallint NOT NULL DEFAULT 0,
+ role char_role NOT NULL DEFAULT 'main'
);
+-- primary key won't work when one column allows NULL
+CREATE UNIQUE INDEX chars_vns_pkey ON chars_vns (cid, vid, COALESCE(rid, 0));
-- cache table
CREATE TABLE traits_chars (