Fix on delete cascade entity order #759

Closed
opened 2026-04-05 17:28:59 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @fanshan on 12/8/2025

Hello,

Since #20708 relation with a on delete RESTRICT are not deleted in the proper order. Then the error violate not-null constraint occurs and breaks the delete cascade feature.

Fixes: #20948

This PR try to fix object on delete order when a relation was set with the action RESTRICT on delete event.

*Originally created by @fanshan on 12/8/2025* Hello, Since [#20708](https://github.com/netbox-community/netbox/pull/20708) relation with a on delete RESTRICT are not deleted in the proper order. Then the error `violate not-null constraint` occurs and breaks the delete cascade feature. <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #20948 This PR try to fix object on delete order when a relation was set with the action `RESTRICT` on delete event.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#759