Updated

db/migrate / 20160713130452_add_signatures_index_for_rate_limiting.rb

A
15 lines of codes
2 methods
2.3 complexity/method
1 churn
4.65 complexity
0 duplications
class AddSignaturesIndexForRateLimiting < ActiveRecord::Migration
  1. AddSignaturesIndexForRateLimiting has no descriptive comment
disable_ddl_transaction! def up unless index_exists?(:signatures, [:created_at, :ip_address, :petition_id]) add_index :signatures, [:created_at, :ip_address, :petition_id], algorithm: :concurrently end end def down if index_exists?(:signatures, [:created_at, :ip_address, :petition_id]) remove_index :signatures, [:created_at, :ip_address, :petition_id] end end end