Files
danbooru/db/migrate/20160219010854_add_trigram_indexes_to_artists.rb
2016-02-18 17:30:26 -08:00

14 lines
576 B
Ruby

class AddTrigramIndexesToArtists < ActiveRecord::Migration
def up
execute "create index index_artists_on_name_trgm on artists using gin (name gin_trgm_ops)"
execute "create index index_artists_on_group_name_trgm on artists using gin (group_name gin_trgm_ops)"
execute "create index index_artists_on_other_names_trgm on artists using gin (other_names gin_trgm_ops)"
end
def down
execute "drop index index_artists_on_other_names_trgm"
execute "drop index index_artists_on_group_name_trgm"
execute "drop index index_artists_on_name_trgm"
end
end