0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 03:25:17 +08:00
discourse/db/migrate/20240912061806_drop_trgm_indexes_on_users.rb
Alan Guo Xiang Tan 02380af75c
PERF: Update migration to drop index concurrently. (#28955)
This avoids locking the index's table
2024-09-18 10:20:24 +08:00

18 lines
398 B
Ruby
Vendored

# frozen_string_literal: true
class DropTrgmIndexesOnUsers < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def up
execute <<~SQL
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
def down
raise ActiveRecord::IrreversibleMigration
end
end