From 39cbaf0cd0a6f1dc16aa56a2f82d8ecd08136212 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Sun, 3 May 2015 09:23:04 +0200 Subject: Remove "script" role from vn<->staff links Note that it's still in the postgresql ENUM type. Removing that is possible, but not very trivial. --- data/docs/2 | 1 - data/global.pl | 2 +- data/lang.txt | 12 ------------ util/updates/update_2.25.sql | 12 ++++++++++++ 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/data/docs/2 b/data/docs/2 index 9b092c5f..1a88d5fe 100644 --- a/data/docs/2 +++ b/data/docs/2 @@ -93,7 +93,6 @@ href="/d16">add it first.

Scenario
 
-
Script
 
Character design
 
Composer
 
Director
 
diff --git a/data/global.pl b/data/global.pl index 6c02d0c0..52792aed 100644 --- a/data/global.pl +++ b/data/global.pl @@ -114,7 +114,7 @@ our %S = (%S, changes => [ 25, 'VNDB Recent Changes', '/hist' ], posts => [ 25, 'VNDB Recent Posts', '/t' ], }, - staff_roles => [qw|scenario script chardesign music director art songs staff|], + staff_roles => [qw|scenario chardesign music director art songs staff|], ); diff --git a/data/lang.txt b/data/lang.txt index 63a22da2..3cd556c0 100644 --- a/data/lang.txt +++ b/data/lang.txt @@ -5395,18 +5395,6 @@ tr*: uk*: it*: -:_credit_script -en : Script -ru*: -cs*: -hu*: -nl*: -de*: -es*: -tr*: -uk*: -it*: - :_credit_chardesign en : Character design ru*: diff --git a/util/updates/update_2.25.sql b/util/updates/update_2.25.sql index 5188cca2..f9168cf7 100644 --- a/util/updates/update_2.25.sql +++ b/util/updates/update_2.25.sql @@ -1,2 +1,14 @@ ALTER TYPE credit_type ADD VALUE 'scenario' BEFORE 'script'; + +BEGIN; +-- There are no entries in the database where a single aid has both a script +-- and a staff role, and where a note has been associated with the script role. +-- So this conversion does not attempt to merge notes when merging roles. +UPDATE vn_staff vs SET role = 'staff', note = CASE WHEN note = '' THEN 'Scripting' ELSE note END + WHERE role = 'script' AND NOT EXISTS(SELECT 1 FROM vn_staff v2 where v2.vid = vs.vid AND v2.aid = vs.aid AND role = 'staff'); +UPDATE vn_staff vs SET note = CASE WHEN note = '' THEN 'Scripting' ELSE note || ', Scripting' END + WHERE role = 'staff' AND EXISTS(SELECT 1 FROM vn_staff v2 where v2.vid = vs.vid AND v2.aid = vs.aid AND role = 'script'); +DELETE FROM vn_staff WHERE role = 'script'; +COMMIT; + -- cgit v1.2.3