20180402040909_create_report_notes.rb 502 B

12345678910111213141516
  1. # frozen_string_literal: true
  2. class CreateReportNotes < ActiveRecord::Migration[5.2]
  3. def change
  4. create_table :report_notes do |t|
  5. t.text :content, null: false
  6. t.references :report, null: false
  7. t.references :account, null: false
  8. t.timestamps
  9. end
  10. safety_assured { add_foreign_key :report_notes, :reports, column: :report_id, on_delete: :cascade }
  11. safety_assured { add_foreign_key :report_notes, :accounts, column: :account_id, on_delete: :cascade }
  12. end
  13. end