2023-03-28 01:09:10 +11:00
|
|
|
class RemoveOldReblogIndexOnStatuses < ActiveRecord::Migration[5.2]
|
2017-11-28 06:22:27 +11:00
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
|
|
|
# This index may not exists (see migration 20171122120436)
|
|
|
|
remove_index :statuses, [:account_id, :reblog_of_id] if index_exists?(:statuses, [:account_id, :reblog_of_id])
|
|
|
|
|
|
|
|
remove_index :statuses, :reblog_of_id
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
add_index :statuses, :reblog_of_id, algorithm: :concurrently
|
|
|
|
end
|
|
|
|
end
|