Sha256: 3398d4433be21701849ea9654a793f259c912c65ab5562b1fdf18900246c56d0

Contents?: true

Size: 1.85 KB

Versions: 6

Compression:

Stored size: 1.85 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

      # 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

6 entries across 6 versions & 2 rubygems

Version Path
authgen-0.0.1 rails_generators/auth/templates/migrations/20100322142300_create_users.rb
gemstreamer-1.2.0 spec/assets/testapp/db/migrate/20091031093219_create_users.rb
gemstreamer-1.1.1 spec/assets/testapp/db/migrate/20091031093219_create_users.rb
gemstreamer-1.1.0 spec/assets/testapp/db/migrate/20091031093219_create_users.rb
gemstreamer-1.0.0 spec/assets/testapp/db/migrate/20091031093219_create_users.rb
gemstreamer-0.0.0 spec/assets/testapp/db/migrate/20091031093219_create_users.rb