summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-05-13 10:40:04 +0200
committerYorhel <git@yorhel.nl>2015-05-13 10:40:04 +0200
commite1096f570ced3976f2b22bb94478317c8384a463 (patch)
tree0cfa48295ef204d31586ef8427816c2be740a48e /util
parenta87f36b5f175d76a744e1a72af708eb89b3582c7 (diff)
Change order of staff roles
https://vndb.org/t6138.226 - https://vndb.org/t6048.132
Diffstat (limited to 'util')
-rw-r--r--util/sql/all.sql2
-rw-r--r--util/updates/update_2.25.sql9
2 files changed, 10 insertions, 1 deletions
diff --git a/util/sql/all.sql b/util/sql/all.sql
index d19adbb7..c4afb502 100644
--- a/util/sql/all.sql
+++ b/util/sql/all.sql
@@ -6,7 +6,7 @@
CREATE TYPE anime_type AS ENUM ('tv', 'ova', 'mov', 'oth', 'web', 'spe', 'mv');
CREATE TYPE blood_type AS ENUM ('unknown', 'a', 'b', 'ab', 'o');
CREATE TYPE char_role AS ENUM ('main', 'primary', 'side', 'appears');
-CREATE TYPE credit_type AS ENUM ('scenario', 'script', 'chardesign', 'music', 'director', 'art', 'songs', 'staff');
+CREATE TYPE credit_type AS ENUM ('scenario', 'chardesign', 'art', 'music', 'songs', 'director', 'staff');
CREATE TYPE dbentry_type AS ENUM ('v', 'r', 'p', 'c', 's');
CREATE TYPE edit_rettype AS (iid integer, cid integer, rev integer);
CREATE TYPE gender AS ENUM ('unknown', 'm', 'f', 'b');
diff --git a/util/updates/update_2.25.sql b/util/updates/update_2.25.sql
index 3d862491..5aef2ece 100644
--- a/util/updates/update_2.25.sql
+++ b/util/updates/update_2.25.sql
@@ -20,3 +20,12 @@ ALTER TYPE platform ADD VALUE 'x68' BEFORE 'xb1';
-- New language
ALTER TYPE language ADD VALUE 'ca' BEFORE 'cs';
+
+
+-- Reorder credit_type (and remove 'script')
+ALTER TYPE credit_type RENAME TO credit_type2;
+CREATE TYPE credit_type AS ENUM ('scenario', 'chardesign', 'art', 'music', 'songs', 'director', 'staff');
+ALTER TABLE vn_staff ALTER role DROP DEFAULT;
+ALTER TABLE vn_staff ALTER role TYPE credit_type USING role::text::credit_type;
+ALTER TABLE vn_staff ALTER role SET DEFAULT 'staff';
+DROP TYPE credit_type2;