~cytrogen/masto-fe

ref: 67055b034300393bd9a345bc057e86baa848ae35 masto-fe/db/migrate/20171125190735_remove_old_reblog_index_on_statuses.rb -rw-r--r-- 419 bytes
67055b03 — Claire Fix import order inconsistencies (#2289) 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class RemoveOldReblogIndexOnStatuses < ActiveRecord::Migration[5.2]
  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