mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 14:03:22 +08:00
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
|
||||
class DropTrgmIndexesOnUsers < ActiveRecord::Migration[7.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
execute <<~SQL
|
||||
DROP INDEX IF EXISTS index_users_on_username_lower_trgm;
|
||||
DROP INDEX IF EXISTS index_users_on_name_trgm;
|
||||
DROP INDEX CONCURRENTLY IF EXISTS index_users_on_username_lower_trgm;
|
||||
SQL
|
||||
|
||||
execute <<~SQL
|
||||
DROP INDEX CONCURRENTLY IF EXISTS index_users_on_name_trgm;
|
||||
SQL
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user