Add effective index to subscriptions (#2885)
parent
2745fc5268
commit
25e2322ca1
@ -0,0 +1,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
|
Loading…
Reference in new issue