diff options
author | multiple creatures <dev@multiple-creature.party> | 2020-01-10 03:45:29 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-01-10 03:45:29 -0600 |
commit | f03960382bd05b8570e0e3b1066545831c59138a (patch) | |
tree | e7f4b362018e17e2a475a9c2e6988b0ebd79ac5d /db/migrate/20200110072034_add_index_to_tsv.rb | |
parent | 4c8591fbeae9054a354f955e37a95aeed369222a (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.rb | 15 |
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 |