Browse Source

Allow for successful rollback of migration.

master
Matt Mueller 11 years ago
parent
commit
ffab2c2dd2
  1. 7
      lib/generators/active_record/templates/migration.rb

7
lib/generators/active_record/templates/migration.rb

@ -1,8 +1,13 @@
class TwoFactorAuthenticationAddTo<%= table_name.camelize %> < ActiveRecord::Migration
def change
def up
change_table :<%= table_name %> do |t|
t.string :otp_secret_key
t.integer :second_factor_attempts_count, :default => 0
end
end
def down
remove_column :<%= table_name %>, :otp_secret_key
remove_column :<%= table_name %>, :second_factor_attempts_count
end
end

Loading…
Cancel
Save