From 558319cc174f00d20db4800905c76c53016d5f46 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 10 Dec 2025 22:59:09 +0000 Subject: [PATCH] Update app/models.py --- app/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models.py b/app/models.py index ff0f1f3..d4862aa 100644 --- a/app/models.py +++ b/app/models.py @@ -23,7 +23,7 @@ class Customer(Base): credit_score = Column(Integer) preferred_contact_method = Column(String(20)) - accounts = relationship("Account", back_populates="customer") + accounts = relationship("Account", back_populates="customer", cascade="all, delete-orphan") class Account(Base): @@ -38,7 +38,7 @@ class Account(Base): branch_id = Column(Integer) customer = relationship("Customer", back_populates="accounts") - transactions = relationship("Transaction", back_populates="account") + transactions = relationship("Transaction", back_populates="account", cascade="all, delete-orphan") class Transaction(Base):