about summary refs log tree commit diff
path: root/db/migrate/20200110072034_add_index_to_tsv.rb
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-01-10 03:45:29 -0600
committermultiple creatures <dev@multiple-creature.party>2020-01-10 03:45:29 -0600
commitf03960382bd05b8570e0e3b1066545831c59138a (patch)
treee7f4b362018e17e2a475a9c2e6988b0ebd79ac5d /db/migrate/20200110072034_add_index_to_tsv.rb
parent4c8591fbeae9054a354f955e37a95aeed369222a (diff)
switch (back) to postgres fts engine for fast search & timeline filters
Diffstat (limited to 'db/migrate/20200110072034_add_index_to_tsv.rb')
-rw-r--r--db/migrate/20200110072034_add_index_to_tsv.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20200110072034_add_index_to_tsv.rb b/db/migrate/20200110072034_add_index_to_tsv.rb
new file mode 100644
index 000000000..d6b66c2d6
--- /dev/null
+++ b/db/migrate/20200110072034_add_index_to_tsv.rb
@@ -0,0 +1,15 @@
+class AddIndexToTsv < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def up
+    safety_assured do
+      execute 'CREATE INDEX CONCURRENTLY statuses_text_vector_idx ON statuses USING GIN(tsv)'
+    end
+  end
+
+  def down
+    safety_assured do
+      execute 'DROP INDEX statuses_text_vector_idx ON statuses'
+    end
+  end
+end