Class: EditUsers

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/templates/migrations/edit_users_table.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/generators/templates/migrations/edit_users_table.rb', line 2

def change
  change_table :users do |t|
    ## Attributes
    t.string :first_name
    t.string :last_name
    t.text :avatar
    t.text :location
    t.timestamps null: false

    ## Database authenticatable
    t.string :email, unique: true, null: false
    t.string :username, unique: true
    t.string :encrypted_password, null: false, default: ''

    ## Confirmable
    t.string   :confirmation_token, unique: true
    t.datetime :confirmed_at
    t.datetime :confirmation_sent_at
    t.string   :unconfirmed_email

    ## Recoverable
    t.string   :reset_password_token
    t.datetime :reset_password_sent_at

    ## Rememberable
    t.datetime :remember_created_at

    ## Trackable
    t.integer  :sign_in_count, default: 0, null: false
    t.datetime :current_sign_in_at
    t.datetime :last_sign_in_at
  end
end