20200516180352_create_devices.rb 559 B

12345678910111213141516
  1. # frozen_string_literal: true
  2. class CreateDevices < ActiveRecord::Migration[5.2]
  3. def change
  4. create_table :devices do |t|
  5. t.references :access_token, foreign_key: { to_table: :oauth_access_tokens, on_delete: :cascade, index: :unique }
  6. t.references :account, foreign_key: { on_delete: :cascade }
  7. t.string :device_id, default: '', null: false
  8. t.string :name, default: '', null: false
  9. t.text :fingerprint_key, default: '', null: false
  10. t.text :identity_key, default: '', null: false
  11. t.timestamps
  12. end
  13. end
  14. end