2023-07-12 16:47:08 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-03-27 23:09:10 +09:00
|
|
|
class CreateReportNotes < ActiveRecord::Migration[5.2]
|
2018-04-03 05:04:14 +09:00
|
|
|
def change
|
|
|
|
create_table :report_notes do |t|
|
|
|
|
t.text :content, null: false
|
|
|
|
t.references :report, null: false
|
|
|
|
t.references :account, null: false
|
|
|
|
|
|
|
|
t.timestamps
|
|
|
|
end
|
|
|
|
|
2019-06-10 05:55:28 +09:00
|
|
|
safety_assured { add_foreign_key :report_notes, :reports, column: :report_id, on_delete: :cascade }
|
|
|
|
safety_assured { add_foreign_key :report_notes, :accounts, column: :account_id, on_delete: :cascade }
|
2018-04-03 05:04:14 +09:00
|
|
|
end
|
|
|
|
end
|