add trigram indexes for artists and pools
This commit is contained in:
11
db/migrate/20160219004022_add_trigram_index_to_pools.rb
Normal file
11
db/migrate/20160219004022_add_trigram_index_to_pools.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class AddTrigramIndexToPools < ActiveRecord::Migration
|
||||
def up
|
||||
execute "create extension pg_trgm"
|
||||
execute "create index index_pools_on_name_trgm on pools using gin (name gin_trgm_ops)"
|
||||
end
|
||||
|
||||
def down
|
||||
execute "drop index index_pools_on_name_trgm"
|
||||
execute "drop extension pg_trgm"
|
||||
end
|
||||
end
|
||||
13
db/migrate/20160219010854_add_trigram_indexes_to_artists.rb
Normal file
13
db/migrate/20160219010854_add_trigram_indexes_to_artists.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
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
|
||||
Reference in New Issue
Block a user