20240320140159_create_account_relationship_severance_events.rb 542 B

12345678910111213141516
  1. # frozen_string_literal: true
  2. class CreateAccountRelationshipSeveranceEvents < ActiveRecord::Migration[7.1]
  3. def change
  4. create_table :account_relationship_severance_events do |t|
  5. t.belongs_to :account, foreign_key: { on_delete: :cascade }, null: false
  6. t.belongs_to :relationship_severance_event, foreign_key: { on_delete: :cascade }, null: false
  7. t.integer :relationships_count, default: 0, null: false
  8. t.index [:account_id, :relationship_severance_event_id], unique: true
  9. t.timestamps
  10. end
  11. end
  12. end