From 06a2e823c738a622625dce599fa19580714834a5 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Wed, 21 Oct 2009 11:30:24 +0200 Subject: Started on the producer relations The current list of relations isn't final yet, may be changed later on. Quite a bit of this code has been copied from the VN relations... need to find a way to use prober code reuse here. TODO: - Nice relation editor interface - Display relations in revision browser - Display relations on producer pages - Generate relation graphs - Sync update_2.8.sql into dump.sql --- util/updates/update_2.8.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'util') diff --git a/util/updates/update_2.8.sql b/util/updates/update_2.8.sql index 54367c9b..1775958c 100644 --- a/util/updates/update_2.8.sql +++ b/util/updates/update_2.8.sql @@ -33,6 +33,22 @@ ALTER TABLE vn_relations ALTER COLUMN relation TYPE vn_relation USING END; +-- producer relations +-- old -> Formerly +-- new -> Succeeded by +-- par -> Parent producer +-- sub -> Subsidairy +-- imp -> Imprint +-- ipa -> Parent brand +CREATE TYPE producer_relation AS ENUM ('old', 'new', 'par', 'sub', 'imp', 'ipa'); +CREATE TABLE producers_relations ( + pid1 integer NOT NULL REFERENCES producers_rev (id), + pid2 integer NOT NULL REFERENCES producers (id), + relation producer_relation NOT NULL, + PRIMARY KEY(pid1, pid2) +); + + -- Anime types stored as enum CREATE TYPE anime_type AS ENUM ('tv', 'ova', 'mov', 'oth', 'web', 'spe', 'mv'); ALTER TABLE anime ALTER COLUMN type TYPE anime_type USING -- cgit v1.2.3