aboutsummaryrefslogtreecommitdiff
path: root/sqitch
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-09-26 11:45:57 +0100
committerChristopher Baines <mail@cbaines.net>2020-09-26 11:45:57 +0100
commit53341c70fcb8888b040230e28bbe5deb1b1773ce (patch)
treedcb38c6985150ef137f64136e1b18afcdd346d22 /sqitch
parentaf2e12a9ef529789017caaba8c866b13f9c34067 (diff)
downloaddata-service-53341c70fcb8888b040230e28bbe5deb1b1773ce.tar
data-service-53341c70fcb8888b040230e28bbe5deb1b1773ce.tar.gz
Change the locale codeset representation
From the normalized one, to the one actually contained within glibc. Recent versions of glibc also contain symlinks linking the normalized codeset to the locales with the .UTF-8 ending, but older ones do not. Maybe handling codeset normalisation for queries would be good, but the locale values ending in .UTF-8 are more compatible and allow the code to be simplified. For querying, maybe there should be a locales table which handles different representations.
Diffstat (limited to 'sqitch')
-rw-r--r--sqitch/deploy/change_locale_values.sql11
-rw-r--r--sqitch/revert/change_locale_values.sql7
-rw-r--r--sqitch/sqitch.plan1
-rw-r--r--sqitch/verify/change_locale_values.sql7
4 files changed, 26 insertions, 0 deletions
diff --git a/sqitch/deploy/change_locale_values.sql b/sqitch/deploy/change_locale_values.sql
new file mode 100644
index 0000000..9069c61
--- /dev/null
+++ b/sqitch/deploy/change_locale_values.sql
@@ -0,0 +1,11 @@
+-- Deploy guix-data-service:change_locale_values to pg
+
+BEGIN;
+
+UPDATE lint_checker_descriptions SET locale = REPLACE(locale, '.utf8', '.UTF-8');
+UPDATE package_metadata_tsvectors SET locale = REPLACE(locale, '.utf8', '.UTF-8');
+UPDATE package_descriptions SET locale = REPLACE(locale, '.utf8', '.UTF-8');
+UPDATE package_synopsis SET locale = REPLACE(locale, '.utf8', '.UTF-8');
+UPDATE lint_warning_messages SET locale = REPLACE(locale, '.utf8', '.UTF-8');
+
+COMMIT;
diff --git a/sqitch/revert/change_locale_values.sql b/sqitch/revert/change_locale_values.sql
new file mode 100644
index 0000000..1771cc9
--- /dev/null
+++ b/sqitch/revert/change_locale_values.sql
@@ -0,0 +1,7 @@
+-- Revert guix-data-service:change_locale_values from pg
+
+BEGIN;
+
+-- XXX Add DDLs here.
+
+COMMIT;
diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan
index 477f869..4d2b101 100644
--- a/sqitch/sqitch.plan
+++ b/sqitch/sqitch.plan
@@ -68,3 +68,4 @@ builds_remove_build_server_id_derivation_unique_constraint 2020-06-30T20:17:48Z
derivation_output_details_sets_derivation_output_details_ids_index 2020-07-04T07:56:49Z Christopher Baines <mail@cbaines.net> # Add GIN index on derivation_output_details_ids
add-tsvectors-per-locale 2020-07-16T18:19:44Z daniela <daniela@linux-ijv5> # Add tsvectors per locale
change_package_descriptions_index 2020-08-23T11:56:00Z Christopher Baines <mail@cbaines.net> # Change the package_descriptions index
+change_locale_values 2020-09-26T10:20:22Z Christopher Baines <mail@cbaines.net> # Change locale values
diff --git a/sqitch/verify/change_locale_values.sql b/sqitch/verify/change_locale_values.sql
new file mode 100644
index 0000000..c435a50
--- /dev/null
+++ b/sqitch/verify/change_locale_values.sql
@@ -0,0 +1,7 @@
+-- Verify guix-data-service:change_locale_values on pg
+
+BEGIN;
+
+-- XXX Add verifications here.
+
+ROLLBACK;