mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
PERF: Update migration to drop index concurrently. (#28955)
This avoids locking the index's table
This commit is contained in:
committed by
GitHub
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user