about summary refs log blame commit diff
path: root/db/migrate/20170507141759_optimize_index_subscriptions.rb
blob: 26acd5c4d3b895ef7c56963bece0a988e4369f01 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11









                                                                        
class OptimizeIndexSubscriptions < ActiveRecord::Migration[5.0]
  def up
    add_index :subscriptions, [:account_id, :callback_url], unique: true
    remove_index :subscriptions, [:callback_url, :account_id]
  end

  def down
    add_index :subscriptions, [:callback_url, :account_id], unique: true
    remove_index :subscriptions, [:account_id, :callback_url]
  end
end