20200628133322_create_account_notes.rb 448 B

1234567891011121314
  1. # frozen_string_literal: true
  2. class CreateAccountNotes < ActiveRecord::Migration[5.2]
  3. def change
  4. create_table :account_notes do |t|
  5. t.references :account, foreign_key: { on_delete: :cascade }, index: false
  6. t.references :target_account, foreign_key: { to_table: :accounts, on_delete: :cascade }
  7. t.text :comment, null: false
  8. t.index [:account_id, :target_account_id], unique: true
  9. t.timestamps
  10. end
  11. end
  12. end