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.

15 lines
550 B

  1. # frozen_string_literal: true
  2. class RemoveIndexNotificationsOnAccountActivity < ActiveRecord::Migration[5.2]
  3. disable_ddl_transaction!
  4. def up
  5. remove_index :notifications, name: :account_activity
  6. remove_index :notifications, name: :index_notifications_on_account_id_and_id
  7. end
  8. def down
  9. add_index :notifications, [:account_id, :activity_id, :activity_type], unique: true, name: 'account_activity', algorithm: :concurrently
  10. add_index :notifications, [:account_id, :id], order: { id: :desc }, algorithm: :concurrently
  11. end
  12. end