You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a nested collection is slated to be deleted during a snapshot apply, if its parent is not also deleted, the schema apply will appear to succeed, but the collection will not be deleted.
A concrete example:
Suppose you have two collections, parent and child. These collections are nested so that child is within parent's group, like so:
parent
child
Attempting to apply a snapshot which containsparent, but does not containchild will appear to delete child, but will silently fail to do so, even if there are no database constraints preventing the deletion.
This issue also applies to more deeply nested collections, where the same constraint holds: if a collection's parent is not deleted, then the collection itself will not be deleted. This implies that in order to delete a deeply nested collection, one must also delete all of its ancestors up to the root.
To Reproduce
From a fresh database, apply Snapshot A. This will create a pair of nested collections, parent and child.
Apply Snapshot B. This second snapshot includes only the parent collection and should result in the deletion of the child collection. Notice that the "Would you like to continue?" prompt reads:
? The following changes will be applied:
Collections:
- Delete child
Describe the Bug
When a nested collection is slated to be deleted during a snapshot apply, if its parent is not also deleted, the schema apply will appear to succeed, but the collection will not be deleted.
A concrete example:
Suppose you have two collections,
parent
andchild
. These collections are nested so thatchild
is withinparent
's group, like so:parent
child
Attempting to apply a snapshot which contains
parent
, but does not containchild
will appear to deletechild
, but will silently fail to do so, even if there are no database constraints preventing the deletion.This issue also applies to more deeply nested collections, where the same constraint holds: if a collection's parent is not deleted, then the collection itself will not be deleted. This implies that in order to delete a deeply nested collection, one must also delete all of its ancestors up to the root.
To Reproduce
parent
andchild
.Snapshot A
parent
collection and should result in the deletion of thechild
collection. Notice that the "Would you like to continue?" prompt reads:Snapshot B
child
table nor thechild
collection has been deleted.Errors Shown
No errors are shown despite behavior differing from what was stated would happen.
What version of Directus are you using?
Directus 9.21.2
What version of Node.js are you using?
Node 18.12.1
What database are you using?
SQL Server 15.0.2000 (SQL Server Express)
What browser are you using?
Chrome 107.0.5304.107, though not relevant for this bug
How are you deploying Directus?
Running locally
The text was updated successfully, but these errors were encountered: