about summary refs log tree commit diff
path: root/web/panettone/src/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'web/panettone/src/migrations')
-rw-r--r--web/panettone/src/migrations/3920286378-add-issue-tsv.lisp5
1 files changed, 5 insertions, 0 deletions
diff --git a/web/panettone/src/migrations/3920286378-add-issue-tsv.lisp b/web/panettone/src/migrations/3920286378-add-issue-tsv.lisp
new file mode 100644
index 000000000000..2a965a7bba80
--- /dev/null
+++ b/web/panettone/src/migrations/3920286378-add-issue-tsv.lisp
@@ -0,0 +1,5 @@
+"Add tsvector for full-text search of issues"
+
+(defun up ()
+  (query "ALTER TABLE issues ADD COLUMN tsv tsvector GENERATED ALWAYS AS (to_tsvector('english', subject || ' ' || body)) STORED")
+  (query "CREATE INDEX issues_tsv_index ON issues USING GIN (tsv);"))