When an order is deleted, the aqorders_items table is not affected.
Created attachment 13304 [details] [review]
Bug 9030: Add constraint on aqorders_items.ordernumber
Created attachment 13349 [details] [review]
[SIGNED-OFF] Bug 9030: Add constraint on aqorders_items.ordernumber
Signed-off-by: Kyle M Hall <email@example.com>
Tested, cruft removed and constraint added.
Created attachment 13595 [details] [review]
Trivial rebase for updatedatabase
(In reply to comment #3)
> Tested, cruft removed and constraint added.
Kyle: Apparently you forgot to update the status to Signed off.
QA Comment: Looks good to me. Tested dbrev on upgrade. No complaints from qa-tools.
Could you please explain how I would test that this constraint is doing what is desired?
(In reply to comment #7)
> Could you please explain how I would test that this constraint is doing what
> is desired?
For the Bug 8991, I developped a script to delete old orders. By "delete" I mean delete a record in DB.
If we delete an order in DB, we want to delete its related items too.
So for testing you can create an order with X items and execute a DELETE query from the aqorders table on this order.
The related items have to be deleted in cascade.
This patch has been pushed to master.