Bug 9030 - There is no constraint on aqorders_items
Summary: There is no constraint on aqorders_items
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-08 12:48 UTC by Jonathan Druart
Modified: 2013-05-23 06:24 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 9030: Add constraint on aqorders_items.ordernumber (2.15 KB, patch)
2012-11-08 12:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 9030: Add constraint on aqorders_items.ordernumber (2.25 KB, patch)
2012-11-09 15:15 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Rebased patch (2.22 KB, patch)
2012-11-21 15:36 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2012-11-08 12:48:45 UTC
When an order is deleted, the aqorders_items table is not affected.
Comment 1 Jonathan Druart 2012-11-08 12:55:05 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall (khall) 2012-11-09 15:15:25 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall (khall) 2012-11-09 15:16:12 UTC
Tested, cruft removed and constraint added.
Comment 4 Marcel de Rooy 2012-11-21 15:36:29 UTC
Created attachment 13595 [details] [review]
Rebased patch

Trivial rebase for updatedatabase
Comment 5 Marcel de Rooy 2012-11-21 15:37:59 UTC
(In reply to comment #3)
> Tested, cruft removed and constraint added.
Kyle: Apparently you forgot to update the status to Signed off.
Comment 6 Marcel de Rooy 2012-11-21 15:40:03 UTC
QA Comment: Looks good to me. Tested dbrev on upgrade. No complaints from qa-tools.
Passed QA
Comment 7 Jared Camins-Esakov 2012-11-25 23:49:25 UTC
Could you please explain how I would test that this constraint is doing what is desired?
Comment 8 Jonathan Druart 2012-11-26 09:36:20 UTC
(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.
Comment 9 Jared Camins-Esakov 2012-11-28 23:50:25 UTC
This patch has been pushed to master.