mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: add cascades for foreign keys
This commit is contained in:
parent
494620d2d6
commit
0fc6713ec8
7 changed files with 216 additions and 6 deletions
|
|
@ -11,6 +11,8 @@ class CollectionCourse(SQLModel, table=True):
|
|||
course_id: int = Field(
|
||||
sa_column=Column(Integer, ForeignKey("course.id", ondelete="CASCADE"))
|
||||
)
|
||||
org_id: int = Field(default=None, foreign_key="organization.id")
|
||||
org_id: int = Field(
|
||||
sa_column=Column(Integer, ForeignKey("organization.id", ondelete="CASCADE"))
|
||||
)
|
||||
creation_date: str
|
||||
update_date: str
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue