Update app/models.py
This commit is contained in:
parent
4a8e63eec1
commit
558319cc17
1 changed files with 2 additions and 2 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue