Class: DeviseCreateUsers

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/engine_room/templates/001_devise_create_users.rb

Class Method Summary collapse

Class Method Details

.downObject



25
26
27
# File 'lib/generators/engine_room/templates/001_devise_create_users.rb', line 25

def self.down
  drop_table :users
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/generators/engine_room/templates/001_devise_create_users.rb', line 2

def self.up
  create_table(:users) do |t|
    t.string :username, :null => false
    t.database_authenticatable :null => false
    t.recoverable
    t.rememberable
    t.trackable

    t.integer :is_admin, :default => 0
    # t.confirmable
    # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
    # t.token_authenticatable


    t.timestamps
  end

  add_index :users, :email,                :unique => true
  add_index :users, :reset_password_token, :unique => true
  # add_index :users, :confirmation_token,   :unique => true
  # add_index :users, :unlock_token,         :unique => true
end