summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-02-02 19:11:11 +0100
committerYorhel <git@yorhel.nl>2010-02-02 19:11:11 +0100
commit57a85d056e754cccec8ba338378f3852acaa2896 (patch)
tree24beee8237122b15dee74b9ad9c96d2c215802e5 /util
parent1c0c4477f76dee105274aab7efe58b4381533b80 (diff)
Differentiate between pt-PT and pt-BR in the languages
As requested, http://vndb.org/t423
Diffstat (limited to 'util')
-rw-r--r--util/updates/update_2.11.sql11
1 files changed, 6 insertions, 5 deletions
diff --git a/util/updates/update_2.11.sql b/util/updates/update_2.11.sql
index f9601ce7..4b5f076c 100644
--- a/util/updates/update_2.11.sql
+++ b/util/updates/update_2.11.sql
@@ -30,24 +30,25 @@ ALTER TABLE threads_boards DROP COLUMN lastread;
-- languages -> ENUM
-CREATE TYPE language AS ENUM('cs', 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja', 'ko', 'nl', 'no', 'pl', 'pt', 'ru', 'sk', 'sv', 'tr', 'vi', 'zh');
+CREATE TYPE language AS ENUM('cs', 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja', 'ko', 'nl', 'no', 'pl', 'pt-pt', 'pt-br', 'ru', 'sk', 'sv', 'tr', 'vi', 'zh');
ALTER TABLE producers_rev ALTER COLUMN lang DROP DEFAULT;
-ALTER TABLE producers_rev ALTER COLUMN lang TYPE language USING lang::language;
+ALTER TABLE producers_rev ALTER COLUMN lang TYPE language USING CASE lang WHEN 'pt' THEN 'pt-pt' ELSE lang::language END;
ALTER TABLE producers_rev ALTER COLUMN lang SET DEFAULT 'ja';
-ALTER TABLE releases_lang ALTER COLUMN lang TYPE language USING lang::language;
+ALTER TABLE releases_lang ALTER COLUMN lang TYPE language USING CASE lang WHEN 'pt' THEN 'pt-pt' ELSE lang::language END;
-- c_languages is an now array of languages, rather than a serialized string
ALTER TABLE vn ALTER COLUMN c_languages DROP DEFAULT;
-ALTER TABLE vn ALTER COLUMN c_languages TYPE language[] USING coalesce(string_to_array(c_languages, '/')::language[], '{}');
+ALTER TABLE vn ALTER COLUMN c_languages TYPE language[] USING '{}';
ALTER TABLE vn ALTER COLUMN c_languages SET DEFAULT '{}';
-
ALTER TABLE changes ADD COLUMN ihid boolean NOT NULL DEFAULT FALSE;
ALTER TABLE changes ADD COLUMN ilock boolean NOT NULL DEFAULT FALSE;
\i util/sql/func.sql
+SELECT COUNT(*) FROM (SELECT update_vncache(id) FROM vn) x;
+
CREATE TRIGGER hidlock_update BEFORE UPDATE ON vn FOR EACH ROW EXECUTE PROCEDURE update_hidlock();
CREATE TRIGGER hidlock_update BEFORE UPDATE ON producers FOR EACH ROW EXECUTE PROCEDURE update_hidlock();
CREATE TRIGGER hidlock_update BEFORE UPDATE ON releases FOR EACH ROW EXECUTE PROCEDURE update_hidlock();