summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2021-11-19 13:33:19 +0100
committerYorhel <git@yorhel.nl>2021-11-19 13:33:19 +0100
commit0a98d9df12cfc6ea73729b0b3feb3fee52c9f336 (patch)
tree777d2b1fd12a7f98825c0c2fef6ff87650867e14 /util
parent6560748025427a7bca6d074a4858a79a7e7ec48c (diff)
Search adjustments + use new search for producers,staff,characters too
Diffstat (limited to 'util')
-rw-r--r--util/updates/2021-11-19-more-search.sql9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/updates/2021-11-19-more-search.sql b/util/updates/2021-11-19-more-search.sql
new file mode 100644
index 00000000..5b6a99b0
--- /dev/null
+++ b/util/updates/2021-11-19-more-search.sql
@@ -0,0 +1,9 @@
+BEGIN;
+\i sql/func.sql
+ALTER TABLE releases DROP COLUMN c_search;
+DROP FUNCTION search_gen(boolean,text[]);
+ALTER TABLE releases ADD COLUMN c_search text NOT NULL GENERATED ALWAYS AS (public.search_gen(ARRAY[title, original])) STORED;
+ALTER TABLE producers ADD COLUMN c_search text NOT NULL GENERATED ALWAYS AS (public.search_gen(ARRAY[name, original]::text[]||string_to_array(alias,E'\n'))) STORED;
+ALTER TABLE chars ADD COLUMN c_search text NOT NULL GENERATED ALWAYS AS (public.search_gen(ARRAY[name, original]::text[]||string_to_array(alias,E'\n'))) STORED;
+ALTER TABLE staff_alias ADD COLUMN c_search text NOT NULL GENERATED ALWAYS AS (public.search_gen(ARRAY[name, original])) STORED;
+COMMIT;