rosa-build/db/migrate/20130624095928_create_token...

20 lines
598 B
Ruby
Raw Permalink Normal View History

class CreateTokens < ActiveRecord::Migration
def change
create_table :tokens do |t|
2014-03-14 17:41:49 +00:00
t.integer :subject_id, null: false, references: nil
2014-01-21 04:51:49 +00:00
t.string :subject_type, null: false
2014-03-14 17:41:49 +00:00
t.integer :creator_id, null: false, references: nil
t.integer :updater_id, references: nil
2014-01-21 04:51:49 +00:00
t.string :status, default: 'active'
t.text :description
2014-01-21 04:51:49 +00:00
t.string :authentication_token, null: false
t.timestamps
end
2014-01-21 04:51:49 +00:00
add_index :tokens, :authentication_token, unique: true
add_index :tokens, [:subject_id, :subject_type]
end
end