20200518083523_create_encrypted_messages.rb 597 B

1234567891011121314151617
  1. # frozen_string_literal: true
  2. class CreateEncryptedMessages < ActiveRecord::Migration[5.2]
  3. def change
  4. create_table :encrypted_messages do |t|
  5. t.references :device, foreign_key: { on_delete: :cascade }
  6. t.references :from_account, foreign_key: { to_table: :accounts, on_delete: :cascade }
  7. t.string :from_device_id, default: '', null: false
  8. t.integer :type, default: 0, null: false
  9. t.text :body, default: '', null: false
  10. t.text :digest, default: '', null: false
  11. t.text :message_franking, default: '', null: false
  12. t.timestamps
  13. end
  14. end
  15. end