Class: CreateActiveRecordOpenidStoreTables

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

Instance Method Summary collapse

Instance Method Details

#downObject



23
24
25
26
# File 'lib/generators/active_record_openid_store/templates/migration.rb', line 23

def down
  drop_table :open_id_associations
  drop_table :open_id_nonces
end

#upObject



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

def up
  create_table :open_id_associations do |t|
    t.binary :server_url, :null => false
    t.string :handle, :null => false
    t.binary :secret, :null => false
    t.integer :issued, :null => false
    t.integer :lifetime, :null => false
    t.string :assoc_type, :null => false

    t.timestamps
  end

  create_table :open_id_nonces do |t|
    t.string :server_url, :null => false
    t.integer :timestamp, :null => false
    t.string :salt, :null => false

    t.timestamps
  end
end