Class: CreateUsersAndIdentities

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/rails/generators/billfold/templates/migration.rb

Class Method Summary collapse

Class Method Details

.downObject



20
21
22
# File 'lib/rails/generators/billfold/templates/migration.rb', line 20

def self.down
  drop_table :identities, :users
end

.upObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rails/generators/billfold/templates/migration.rb', line 4

def self.up
  create_table :users do |t|
    t.string :name, :null => false
    #Any additional fields here
    t.timestamps
  end

  create_table :identities do |t|
    t.integer    :user_id,      :null => false
    t.string     :provider,     :null => false
    t.string     :value,        :null => false
    t.text       :data
    t.timestamps
  end
end