20200516180352_create_devices.rb 528 B

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