Sha256: e9c2d2b4629f0fbbc8e44f17f80da3ea127856038afd2329a7852b121015aec0

Contents?: true

Size: 1.41 KB

Versions: 1

Compression:

Stored size: 1.41 KB

Contents

class CreateUsers < ActiveRecord::Migration
  def self.up

    # USERS
    create_table :users do |t|
      t.column :full_name,                 :string
      t.column :email,                     :string
      t.column :login,                     :string
      t.column :time_zone,                 :string
      t.column :crypted_password,          :string, :limit => 40
      t.column :salt,                      :string, :limit => 40
      t.column :created_at,                :datetime
      t.column :updated_at,                :datetime
      t.column :remember_token,            :string
      t.column :remember_token_expires_at, :datetime
      t.column :reset_token,               :string
      t.column :reset_token_expires_at,    :datetime
      t.column :access_level,              :int             
    end    
    
    add_index :users, :full_name
    add_index :users, :email
    add_index :users, :login

    ######### THIS SHOULD BE IN THE seeds.rb file
    ActionMailer::Base.perform_deliveries = false

    User.create (:full_name => 'Admin User', 
                  :email => 'admin@test.com', 
                  :login => 'admin', 
                  :time_zone => "Pacific Time (US & Canada)",
                  :password => 'nopassword', 
                  :password_confirmation => 'nopassword', 
                  :access_level => User::ACCESS_LEVEL_ADMIN )  
    
  end

  def self.down
    drop_table :users 
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rules_engine_users-0.0.1 rails_generators/templates/db/migrate/20100104014507_create_users.rb