Altered the Cardinality of the foreign keys to be non-nullable

This commit is contained in:
Gustavo Henrique Santos Souza de Miranda
2025-06-05 22:01:54 -03:00
parent be1bce9261
commit 103b9a9da1
5 changed files with 21 additions and 10 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ class Entry(Base):
"Photo",
secondary=photo_entry_association,
back_populates="entries")
fk_travel_diary_id = Column(Integer, ForeignKey("travel_diaries.id"))
fk_travel_diary_id = Column(Integer, ForeignKey("travel_diaries.id"),nullable=False)
def __init__(self, title: str, text: str, date: str, travel_diary_id: int, **kw: Any):
super().__init__(**kw)
self.title = title