Foreign key with ondelete set null #613
Unanswered
jfernandez-majorel
asked this question in
Questions
Replies: 1 comment
-
Have you tried adding class Client(UUIDModel, SQLModel):
number_login: str = Field(max_length=20, nullable=False, index=True)
uuid_fiber_appointment: Optional[uuid_pkg.UUID] = Field(
foreign_key="fiber_appointment.uuid",
nullable=True,
)
fiber_appointment: "FiberAppointment" = Relationship(
back_populates="clients",
sa_relationship_kwargs={"lazy": "selectin", "cascade": ""},
) Try it |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
I need to delete a list of appointments and that the clients that had those appointments, in the foreign key field (uuid_fiber_appointment) be set to null
Operating System
macOS
Operating System Details
No response
SQLModel Version
0.0.8
Python Version
Python 3.10.11
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions