summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2022-02-19 14:09:12 +0100
committerYorhel <git@yorhel.nl>2022-02-19 14:09:14 +0100
commit33b209a8c90a2bfc8d796c817b3c677402fc4a5e (patch)
tree28113934ed575658ea6de20f30b4dce7502ee5e3 /util
parent43a707c5298409f326ae15b8771e63945a29e5d5 (diff)
Use special "vnt.sorttitle" column for sorting & alphabet filtering
This column simply picks the latin version of the chosen display title, as if the "latin" checkbox is always set.
Diffstat (limited to 'util')
-rw-r--r--util/updates/2022-02-19-vnt-sorttitle.sql2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/updates/2022-02-19-vnt-sorttitle.sql b/util/updates/2022-02-19-vnt-sorttitle.sql
new file mode 100644
index 00000000..ea075343
--- /dev/null
+++ b/util/updates/2022-02-19-vnt-sorttitle.sql
@@ -0,0 +1,2 @@
+DROP VIEW vnt;
+CREATE VIEW vnt AS SELECT v.*, COALESCE(vo.latin, vo.title) AS title, COALESCE(vo.latin, vo.title) AS sorttitle, CASE WHEN vo.latin IS NULL THEN '' ELSE vo.title END AS alttitle FROM vn v JOIN vn_titles vo ON vo.id = v.id AND vo.lang = v.olang;