Class: CreateUsers

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/esp_auth/install/templates/db/migrate/create_users.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
# File 'lib/generators/esp_auth/install/templates/db/migrate/create_users.rb', line 2

def change
  create_table :users do | t |
    t.string  :uid                # omniauth[:uid]
    t.text    :name,              # omniauth[:info]
              :email,
              :nickname,
              :first_name,
              :last_name,
              :location,
              :description,
              :image,
              :phone,
              :urls
    t.text    :raw_info           # omniauth[:extra]

    # Trackable
    t.integer  :sign_in_count
    t.datetime :current_sign_in_at
    t.datetime :last_sign_in_at
    t.string   :current_sign_in_ip
    t.string   :last_sign_in_ip

    t.timestamps
  end

  add_index :users, :uid
end