Sha256: e8302a205de36f59b89d1870ee86f4e1ab6c526ffa1628f6eb08cd228b6b608a

Contents?: true

Size: 1.1 KB

Versions: 7

Compression:

Stored size: 1.1 KB

Contents

class DeviseOtpAddToUsers < ActiveRecord::Migration
  def self.up
    change_table :users do |t|
      t.string    :otp_auth_secret
      t.string    :otp_recovery_secret
      t.boolean   :otp_enabled,          :default => false, :null => false
      t.boolean   :otp_mandatory,        :default => false, :null => false
      t.datetime  :otp_enabled_on
      t.integer   :otp_time_drift,       :default => 0, :null => false
      t.integer   :otp_failed_attempts,  :default => 0, :null => false
      t.integer   :otp_recovery_counter, :default => 0, :null => false
      t.string    :otp_persistence_seed

      t.string    :otp_session_challenge
      t.datetime  :otp_challenge_expires
    end

    add_index :users, :otp_session_challenge,  :unique => true
    add_index :users, :otp_challenge_expires
  end
  
  def self.down
    change_table :users do |t|
      t.remove :otp_auth_secret, :otp_recovery_secret, :otp_enabled, :otp_mandatory, :otp_enabled_on, :otp_session_challenge,
          :otp_challenge_expires, :otp_time_drift, :otp_failed_attempts, :otp_recovery_counter, :otp_persistence_seed
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
devise-otp2-0.2.6 test/dummy/db/migrate/20130131160351_devise_otp_add_to_users.rb
devise-otp2-0.2.5 test/dummy/db/migrate/20130131160351_devise_otp_add_to_users.rb
devise-otp2-0.2.4 test/dummy/db/migrate/20130131160351_devise_otp_add_to_users.rb
devise-otp-0.2.3 test/dummy/db/migrate/20130131160351_devise_otp_add_to_users.rb
devise-otp-0.2.2 test/dummy/db/migrate/20130131160351_devise_otp_add_to_users.rb
devise-otp-0.2.0 test/dummy/db/migrate/20130131160351_devise_otp_add_to_users.rb
devise-otp-0.1.1 test/dummy/db/migrate/20130131160351_devise_otp_add_to_users.rb