Open tartieret opened 1 year ago
Hi @tartieret, thanks for the detailed report. We are able to reproduce this and are looking into it.
@mShan0 any update on this? thanks for your help
Hi @tartieret, apologies for the delay. This is in our backlog and will be worked on. However, no concrete timeline for when it will be fixed.
There are some features which are not supported yet. Please check the Limitations first to see if your bug is listed.
Software versions
Table schema and Model
Consider the example below with
Client
andFolder
models. Folders are linked to each other in a tree structure by referencing each other.Database Connection Settings N/A
Problem description and steps to reproduce
Expected behavior and actual behavior
As folder instances are related through a "restrict" foreign key, we should not be able to delete a folder without first deleting all of its "children". However, thanks for the specific behaviour of the "restrict" policy for foreign key (https://docs.djangoproject.com/en/4.1/ref/models/fields/#django.db.models.RESTRICT), deleting the client object should delete all the related folders through a cascade operation.
Instead, calling
client1.delete()
raises an exception and fails.Error message/stack trace
Any other details that can be helpful
Note that this case works perfectly with PostgreSQL and psycopg2.