Delete SectionEvent with related entities
When SectionEvent is deleted and there are ImageRef entities, if fails with foreign key constraint failure.
AC
-
on deleting SectionEvent, make sure ImageRefs are also deleted -
on deleting Observation, make sure ImageRefs are also deleted -
on deleting ImageRef, make sure ThumbnailRefs are deleted -
check the possibility to delete the images also in the bucket -
tests are running
Example request:
mutation {
deleteSectionEvent(
input: {
id: "/tmd/api/index.php/section_events/33"
}
)
{
sectionEvent {
id
}
}
}
Error message:
"debugMessage": "An exception occurred while executing 'DELETE FROM \"observation\" WHERE id = ?' with params [47]:\n\nSQLSTATE[23503]: Foreign key violation: 7 ERROR: update or delete on table \"observation\" violates foreign key constraint \"fk_4c85eef01409dd88\" on table \"image_ref\"\nDETAIL: Key (id)=(47) is still referenced from table \"image_ref\"."
Edited by Michael Voigt