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.

13 lines
526 B

  1. class AddIndexOnMediaAttachmentsAccountIdStatusId < ActiveRecord::Migration[5.2]
  2. disable_ddl_transaction!
  3. def up
  4. add_index :media_attachments, [:account_id, :status_id], order: { status_id: :desc }, algorithm: :concurrently
  5. remove_index :media_attachments, :account_id, algorithm: :concurrently
  6. end
  7. def down
  8. add_index :media_attachments, :account_id, algorithm: :concurrently
  9. remove_index :media_attachments, [:account_id, :status_id], order: { status_id: :desc }, algorithm: :concurrently
  10. end
  11. end