-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
Description
Currently, the ForeignKey field in our ORM does not properly enforce on_delete behaviors (CASCADE and SET NULL). When a record with a foreign key reference is deleted, related records are not affected as expected.
Expected Behavior
- If
on_delete='CASCADE', all related records in the foreign key table should be deleted. - If
on_delete='SET NULL', the foreign key field in related records should be set toNULL.
Current Issue
- Deleting a record does not propagate changes to related records.
- Foreign key constraints do not properly handle cascading deletes or nullifying references.
Proposed Solution
Modify the delete method to:
- Identify related
ForeignKeyfields before deletion. - Apply the correct behavior (
CASCADEorSET NULL) to related records before executing the delete query. - Ensure consistency across related models.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request