PERF: Update migration to drop index concurrently. (#28955)
This avoids locking the index's table
This commit is contained in:
parent
9a2e6fc890
commit
02380af75c
|
@ -1,9 +1,14 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
class DropTrgmIndexesOnUsers < ActiveRecord::Migration[7.1]
|
class DropTrgmIndexesOnUsers < ActiveRecord::Migration[7.1]
|
||||||
|
disable_ddl_transaction!
|
||||||
|
|
||||||
def up
|
def up
|
||||||
execute <<~SQL
|
execute <<~SQL
|
||||||
DROP INDEX IF EXISTS index_users_on_username_lower_trgm;
|
DROP INDEX CONCURRENTLY IF EXISTS index_users_on_username_lower_trgm;
|
||||||
DROP INDEX IF EXISTS index_users_on_name_trgm;
|
SQL
|
||||||
|
|
||||||
|
execute <<~SQL
|
||||||
|
DROP INDEX CONCURRENTLY IF EXISTS index_users_on_name_trgm;
|
||||||
SQL
|
SQL
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue