This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2023-07-12 00:47:08 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-03-27 07:09:10 -07:00
|
|
|
class RemoveOldReblogIndexOnStatuses < ActiveRecord::Migration[5.2]
|
2017-11-27 11:22:27 -08: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
|