Sha256: 5e6d32ae2330c538b833a5f011322eb20b384f2de1cacbdf6e821dd6ed488c79

Contents?: true

Size: 1.92 KB

Versions: 20

Compression:

Stored size: 1.92 KB

Contents

class CreateUsers < ActiveRecord::Migration
  def self.up
    create_table :users do |t|
      t.string    :login,               :null => false                # optional, you can use email instead, or both
      t.string    :email,               :null => false                # optional, you can use login instead, or both
      t.string    :crypted_password,    :null => false                # optional, see below
      t.string    :password_salt,       :null => false                # optional, but highly recommended
      t.string    :persistence_token,   :null => false                # required
      t.string    :single_access_token, :null => false                # optional, see Authlogic::Session::Params
      t.string    :perishable_token,    :null => false                # optional, see Authlogic::Session::Perishability
      t.string    :role,                :null => false, :default => 'user'

      # Magic columns, just like ActiveRecord's created_at and updated_at. These are automatically maintained by Authlogic if they are present.
      t.integer   :login_count,         :null => false, :default => 0 # optional, see Authlogic::Session::MagicColumns
      t.integer   :failed_login_count,  :null => false, :default => 0 # optional, see Authlogic::Session::MagicColumns
      t.datetime  :last_request_at                                    # optional, see Authlogic::Session::MagicColumns
      t.datetime  :current_login_at                                   # optional, see Authlogic::Session::MagicColumns
      t.datetime  :last_login_at                                      # optional, see Authlogic::Session::MagicColumns
      t.string    :current_login_ip                                   # optional, see Authlogic::Session::MagicColumns
      t.string    :last_login_ip                                      # optional, see Authlogic::Session::MagicColumns
      t.timestamps
    end
  end

  def self.down
    drop_table :users
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
i0n_rails3_generators-0.2.19 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.18 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.17 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.16 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.15 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.14 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.13 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.12 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.11 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.10 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.9 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.8 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.7 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.6 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.5 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.4 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.3 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.2 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.1 lib/generators/authlogic/complete/templates/migration_create_users.rb
i0n_rails3_generators-0.2.0 lib/generators/authlogic/complete/templates/migration_create_users.rb