|author||Yorhel <firstname.lastname@example.org>||2009-09-26 10:59:18 +0200|
|committer||Yorhel <email@example.com>||2009-09-26 10:59:18 +0200|
Converted VN relations to ENUM data type and made them translatable
OK, these are actually two separate things: to make the relations translatable they didn't necessarily have to be stored as enum, and I could've also converted them to enum but not have it translatable. Nevertheless, it was easier to just do both at the same time. Also note how I used the string "$____vnrel_<rel>____$" as identifier in the relation graphs while I could have used something a lot shorter ("$<rel>$" would have been fine, for example). This is done so that graphviz can make some space for those relations - the long identifier gives a slightly more realistic representation of the actual length of the relation titles.
Diffstat (limited to 'util')
1 files changed, 18 insertions, 0 deletions
diff --git a/util/updates/update_2.8.sql b/util/updates/update_2.8.sql
index a48c1e73..f9704be3 100644
@@ -14,3 +14,21 @@ CREATE TABLE vn_graphs (
ALTER TABLE vn ADD FOREIGN KEY (rgraph) REFERENCES vn_graphs (id);
+-- VN relations stored as enum
+CREATE TYPE vn_relation AS ENUM ('seq', 'preq', 'set', 'alt', 'char', 'side', 'par', 'ser', 'fan', 'orig');
+ALTER TABLE vn_relations ALTER COLUMN relation DROP DEFAULT;
+ALTER TABLE vn_relations ALTER COLUMN relation TYPE vn_relation USING
+ WHEN relation = 0 THEN 'seq'::vn_relation
+ WHEN relation = 1 THEN 'preq'
+ WHEN relation = 2 THEN 'set'
+ WHEN relation = 3 THEN 'alt'
+ WHEN relation = 4 THEN 'char'
+ WHEN relation = 5 THEN 'side'
+ WHEN relation = 6 THEN 'par'
+ WHEN relation = 7 THEN 'ser'
+ WHEN relation = 8 THEN 'fan'
+ ELSE 'orig'