20190316190352_create_account_identity_proofs.rb 703 B

123456789101112131415161718
  1. # frozen_string_literal: true
  2. class CreateAccountIdentityProofs < ActiveRecord::Migration[5.2]
  3. def change
  4. create_table :account_identity_proofs do |t|
  5. t.belongs_to :account, foreign_key: { on_delete: :cascade }
  6. t.string :provider, null: false, default: ''
  7. t.string :provider_username, null: false, default: ''
  8. t.text :token, null: false, default: ''
  9. t.boolean :verified, null: false, default: false
  10. t.boolean :live, null: false, default: false
  11. t.timestamps null: false
  12. end
  13. add_index :account_identity_proofs, [:account_id, :provider, :provider_username], unique: true, name: :index_account_proofs_on_account_and_provider_and_username
  14. end
  15. end