fix index on tag name prefixes (#3858)

This commit is contained in:
Albert Yi
2018-09-13 11:43:57 -07:00
parent 7c6ef9f22c
commit 4b75ccf89f

View File

@@ -0,0 +1,7 @@
class FixTagPrefixIndex < ActiveRecord::Migration[5.2]
def change
execute "set statement_timeout = 0"
execute "DROP INDEX index_tags_on_name_prefix"
execute "CREATE INDEX index_tags_on_name_prefix ON tags USING gin (REGEXP_REPLACE(name, '([a-z0-9])[a-z0-9'']*($|[^a-z0-9'']+)', '\\1', 'g') gin_trgm_ops)"
end
end