The console tools do not generate the proper DDL statements for the constraints declared as part of the relationship annotations.
Take this entity field declaration, e.g. :
This declaration should generate some sort of ON DELETE CASCADE constraint, or at least actually cascade the delete, in whatever way. It does not. I reviewed the generated DDL statements with
And it clearly showed that no "ON DELETE CASCADE" was generated. Neither did Doctrine 2 perform a cascading delete otherwise.
The delete simply does not cascade.
Subsequently, I end up getting errors like:
Exception 'PDOException' with message 'SQLSTATE: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails
(`invoiceCreatorDB/AnalogOrderInvoiceLineItem`, CONSTRAINT `AnalogOrderInvoiceLineItem_ibfk_1` FOREIGN KEY (`partialInvoice_dbID`) REFERENCES `PartialInvoice` (`dbID`))'
The query that caused the error is:
(PartialInvoice is the entity containing the above field declaration).
It seems that the cascading delete feature is fundamentally broken.