Sha256: 63ac7662533abb0c641e605a4e060d0f064a39df4f3491ec4078263167ab3f63

Contents?: true

Size: 1.85 KB

Versions: 72

Compression:

Stored size: 1.85 KB

Contents

class AddDeviseToUsers < ActiveRecord::Migration
  def self.up
    null    = false
    default = ""

    add_column :users, :encrypted_password, :string, :null => null, :default => default, :limit => 128
    add_column :users, :password_salt, :string
    add_column :users, :authentication_token, :string
    add_column :users, :confirmation_token,   :string
    add_column :users, :confirmed_at,         :datetime
    add_column :users, :confirmation_sent_at, :datetime
    add_column :users, :reset_password_token, :string
    add_column :users, :remember_token,      :string
    add_column :users, :remember_created_at, :datetime
    add_column :users, :sign_in_count,      :integer, :default => 0
    add_column :users, :current_sign_in_at, :datetime
    add_column :users, :last_sign_in_at,    :datetime
    add_column :users, :current_sign_in_ip, :string
    add_column :users, :last_sign_in_ip,    :string

    #:lockable fields contributed by MattSlay
    add_column :users, :failed_attempts, :integer, :default => 0
    add_column :users, :unlock_token,   :string
    add_column :users, :locked_at, :datetime

  end

  def self.down
    remove_column :users, :encrypted_password
    remove_column :users, :password_salt
    remove_column :users, :authentication_token
    remove_column :users, :confirmation_token
    remove_column :users, :confirmed_at
    remove_column :users, :confirmation_sent_at
    remove_column :users, :reset_password_token
    remove_column :users, :remember_token
    remove_column :users, :remember_created_at
    remove_column :users, :sign_in_count
    remove_column :users, :current_sign_in_at
    remove_column :users, :last_sign_in_at
    remove_column :users, :current_sign_in_ip
    remove_column :users, :last_sign_in_ip
    remove_column :users, :failed_attempts
    remove_column :users, :unlock_token
    remove_column :users, :locked_at
  end
end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
old_sql-1.40.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.39.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.38.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.37.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.36.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.35.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.34.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.33.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.32.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.31.1 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.30.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.29.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.28.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.27.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.26.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.25.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.24.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.23.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.22.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb
old_sql-1.21.0 lib/generators/old_sql/templates/add_devise_to_users_migration.rb