artist urls: add trigram indexes on urls.

This commit is contained in:
evazion
2018-09-15 19:37:45 -05:00
parent c9b3c8d217
commit 4a84ec9e26
2 changed files with 19 additions and 12 deletions

View File

@@ -0,0 +1,12 @@
class AddTrigramIndexToArtistUrls < ActiveRecord::Migration[5.2]
def change
change_table :artist_urls do |t|
t.remove_index column: :url, name: :index_artist_urls_on_url
t.remove_index column: :url, name: :index_artist_urls_on_url_pattern, opclass: :text_pattern_ops
t.remove_index column: :normalized_url, name: :index_artist_urls_on_normalized_url
t.index :url, name: :index_artist_urls_on_url_trgm, using: :gin, opclass: :gin_trgm_ops
t.index :normalized_url, name: :index_artist_urls_on_normalized_url_trgm, using: :gin, opclass: :gin_trgm_ops
end
end
end