Class: CreateIdentities

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/templates/migrations/create_identities_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
# File 'lib/generators/templates/migrations/create_identities_table.rb', line 2

def change
  create_table :identities do |t|
    ## Attributes
    t.string :uid, null: false
    t.string :provider, null: false
    t.string :oauth_token, null: false
    t.string :oauth_secret
    t.datetime :expires_at
    t.timestamps null: false

    ## Associations
    t.belongs_to :user, foreign_key: true
  end

  add_index :identities, [:provider, :uid]
end