20170507141759_optimize_index_subscriptions.rb 402 B

12345678910111213
  1. # frozen_string_literal: true
  2. class OptimizeIndexSubscriptions < ActiveRecord::Migration[5.0]
  3. def up
  4. add_index :subscriptions, [:account_id, :callback_url], unique: true
  5. remove_index :subscriptions, [:callback_url, :account_id]
  6. end
  7. def down
  8. add_index :subscriptions, [:callback_url, :account_id], unique: true
  9. remove_index :subscriptions, [:account_id, :callback_url]
  10. end
  11. end