You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
glitchier-soc/db/migrate/20171125190735_remove_old_r...

17 lines
450 B

# frozen_string_literal: true
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