Updated

db/migrate / 20160704152204_add_invalidation_columns_to_signatures.rb

A
31 lines of codes
2 methods
7.0 complexity/method
1 churn
13.96 complexity
0 duplications
class AddInvalidationColumnsToSignatures < ActiveRecord::Migration
  1. AddInvalidationColumnsToSignatures has no descriptive comment
disable_ddl_transaction! def up unless column_exists?(:signatures, :invalidated_at) add_column :signatures, :invalidated_at, :datetime end unless column_exists?(:signatures, :invalidation_id) add_column :signatures, :invalidation_id, :integer end unless index_exists?(:signatures, :invalidation_id) add_index :signatures, :invalidation_id, algorithm: :concurrently end end def down if index_exists?(:signatures, :invalidation_id) remove_index :signatures, :invalidation_id end if column_exists?(:signatures, :invalidation_id) add_column :signatures, :invalidation_id, :datetime end if column_exists?(:signatures, :invalidated_at) add_column :signatures, :invalidated_at, :integer end end end