Sha256: 2d20ba1aa14088c6f7822729dcd47d90cf296be603adbcac434b36dfe82a9e2f

Contents?: true

Size: 1.39 KB

Versions: 2

Compression:

Stored size: 1.39 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 => "Melbourne",
                  :password => 'nopassword', 
                  :password_confirmation => 'nopassword', 
                  :access_level => User::ACCESS_LEVEL_ADMIN )  
    
  end

  def self.down
    drop_table :users 
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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