0
0
Fork 0

Fix account_relationship_severance_events unique indexes (#29665)

This commit is contained in:
Claire 2024-03-20 17:08:34 +01:00 committed by GitHub
parent 99c9db5f67
commit d4449cc682
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 4 deletions

View file

@ -3,11 +3,13 @@
class CreateAccountRelationshipSeveranceEvents < ActiveRecord::Migration[7.1]
def change
create_table :account_relationship_severance_events do |t|
t.belongs_to :account, foreign_key: { on_delete: :cascade }, null: false, index: { unique: true }
t.belongs_to :relationship_severance_event, foreign_key: { on_delete: :cascade }, null: false, index: { unique: true }
t.belongs_to :account, foreign_key: { on_delete: :cascade }, null: false
t.belongs_to :relationship_severance_event, foreign_key: { on_delete: :cascade }, null: false
t.integer :relationships_count, default: 0, null: false
t.index [:account_id, :relationship_severance_event_id], unique: true
t.timestamps
end
end