summaryrefslogtreecommitdiff
path: root/util/updates
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-10-11 12:00:48 +0200
committerYorhel <git@yorhel.nl>2015-10-11 12:00:48 +0200
commit15382265b39f045fc5f20e9e676b24941da6bd63 (patch)
tree89a581d32849e113f28de85746d3d12cd5108998 /util/updates
parent3d10c6358eb0594a6a2970facf56e79205e002a4 (diff)
SQL: Convert producers_rev.type into enum
Same reasoning as 19ce5fcf536ed478ad34b6b1014bf6f44841d25d
Diffstat (limited to 'util/updates')
-rw-r--r--util/updates/update_2.25.sql7
1 files changed, 7 insertions, 0 deletions
diff --git a/util/updates/update_2.25.sql b/util/updates/update_2.25.sql
index 07275ae7..6302daaf 100644
--- a/util/updates/update_2.25.sql
+++ b/util/updates/update_2.25.sql
@@ -67,3 +67,10 @@ $$ LANGUAGE sql IMMUTABLE;
-- Changes to search normalization
UPDATE vn SET c_search = NULL;
+
+
+-- Convert producers_rev.type to enum
+CREATE TYPE producer_type AS ENUM ('co', 'in', 'ng');
+ALTER TABLE producers_rev ALTER COLUMN type DROP DEFAULT;
+ALTER TABLE producers_rev ALTER COLUMN type TYPE producer_type USING type::producer_type;
+ALTER TABLE producers_rev ALTER COLUMN type SET DEFAULT 'co';