scinote-web/db/migrate/20170803153030_add_user_identity_table.rb

14 lines
400 B
Ruby
Raw Normal View History

class AddUserIdentityTable < ActiveRecord::Migration[4.2]
2017-08-30 00:49:07 +08:00
def change
create_table :user_identities do |t|
t.belongs_to :user, index: true
t.string :provider, null: false
t.string :uid, null: false
t.timestamps null: true
end
add_index :user_identities, %i(provider uid), unique: true
add_index :user_identities, %i(user_id provider), unique: true
end
end