Sha256: 5af3b6b6349dbb3e3c27f996ca460a8291a7fbaa94feb19f04eb8fd22142b710

Contents?: true

Size: 460 Bytes

Versions: 5

Compression:

Stored size: 460 Bytes

Contents

class TwoFactorAuthenticationAddTo<%= table_name.camelize %> < ActiveRecord::Migration
  def up
    change_table :<%= table_name %> do |t|
      t.string   :otp_secret_key
      t.integer  :second_factor_attempts_count, :default => 0
    end

    add_index :<%= table_name %>, :otp_secret_key, :unique => true
  end

  def down
    remove_column :<%= table_name %>, :otp_secret_key
    remove_column :<%= table_name %>, :second_factor_attempts_count
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
two_factor_authentication-1.1.4 lib/generators/active_record/templates/migration.rb
two_factor_authentication-1.1.3 lib/generators/active_record/templates/migration.rb
two_factor_authentication-1.1.1 lib/generators/active_record/templates/migration.rb
two_factor_authentication-1.1 lib/generators/active_record/templates/migration.rb
two_factor_authentication-1.0 lib/generators/active_record/templates/migration.rb