Update app/models.py

This commit is contained in:
Cameron 2025-12-10 22:59:09 +00:00
parent 4a8e63eec1
commit 558319cc17

View file

@ -23,7 +23,7 @@ class Customer(Base):
credit_score = Column(Integer) credit_score = Column(Integer)
preferred_contact_method = Column(String(20)) 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): class Account(Base):
@ -38,7 +38,7 @@ class Account(Base):
branch_id = Column(Integer) branch_id = Column(Integer)
customer = relationship("Customer", back_populates="accounts") 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): class Transaction(Base):