[Bug 12601] New: aqorders.budget_id should be a foreign key
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Bug ID: 12601 Summary: aqorders.budget_id should be a foreign key Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart@biblibre.com QA Contact: testopia@bugs.koha-community.org When creating an order, the fund value is mandatory but the DB structure does not show this constraint. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |5334 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 29820 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=29820&action=edit Bug 12601: Add a foreign key for aqorders.budget_id When creating an order, the fund value is mandatory but the DB structure does not show this constraint. The aqorders.budget_id field should be linked to aqbudgets.budget_id. The updatedatabase.pl (entry 3.01.00.077) commented this constraint, certainly for a retro compatibility reason. Actually I found some cases (in production) where aqorders.budget_id is set to "0". To add this constraint, we should add a temporary fund to linked orphan orders. Test plan: 0/ Verify it is not possible to create an order not linked to a fund via the Koha interface. 1/ Using your SQL CLI (or equivalent), create or update 1+ orders and set "0" in the budget_id field. 2/ Execute the updatedabase script. 3/ Verify that your order is linked to a new fund (which is linked to a new budget). 4/ Verify the constraint has correctly been added (show create table aqorders). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Acquisitions |Architecture, internals, | |and plumbing Assignee|koha-bugs@lists.koha-commun |jonathan.druart@biblibre.co |ity.org |m -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Medium patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |srdjan@catalyst.net.nz --- Comment #2 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- And what about kohastructure.sql? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #29820|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 30977 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=30977&action=edit Bug 12601: Add a foreign key for aqorders.budget_id When creating an order, the fund value is mandatory but the DB structure does not show this constraint. The aqorders.budget_id field should be linked to aqbudgets.budget_id. The updatedatabase.pl (entry 3.01.00.077) commented this constraint, certainly for a retro compatibility reason. Actually I found some cases (in production) where aqorders.budget_id is set to "0". To add this constraint, we should add a temporary fund to linked orphan orders. Test plan: 0/ Verify it is not possible to create an order not linked to a fund via the Koha interface. 1/ Using your SQL CLI (or equivalent), create or update 1+ orders and set "0" in the budget_id field. 2/ Execute the updatedabase script. 3/ Verify that your order is linked to a new fund (which is linked to a new budget). 4/ Verify the constraint has correctly been added (show create table aqorders). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Srdjan Jankovic from comment #2)
And what about kohastructure.sql?
Oops, added! I also added a warning message on deleting a fund. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13007 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Paola Rossi <paola.rossi@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |paola.rossi@cineca.it -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Paola Rossi <paola.rossi@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #30977|0 |1 is obsolete| | --- Comment #5 from Paola Rossi <paola.rossi@cineca.it> --- Created attachment 32543 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32543&action=edit Bug 12601: Add a foreign key for aqorders.budget_id I've applied the patch against master 3.17.00.029 The patch needs a trivial rebase. Everything is OK. So I pass the patch to "Signed Off" status. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |kyle@bywatersolutions.com --- Comment #6 from Kyle M Hall <kyle@bywatersolutions.com> --- Database update stanza contains a db revision instead of XXX. Causing a merge conflict. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #32543|0 |1 is obsolete| | --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 32777 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32777&action=edit Bug 12601: Add a foreign key for aqorders.budget_id When creating an order, the fund value is mandatory but the DB structure does not show this constraint. The aqorders.budget_id field should be linked to aqbudgets.budget_id. The updatedatabase.pl (entry 3.01.00.077) commented this constraint, certainly for a retro compatibility reason. Actually I found some cases (in production) where aqorders.budget_id is set to "0". To add this constraint, we should add a temporary fund to linked orphan orders. Test plan: 0/ Verify it is not possible to create an order not linked to a fund via the Koha interface. 1/ Using your SQL CLI (or equivalent), create or update 1+ orders and set "0" in the budget_id field. 2/ Execute the updatedabase script. 3/ Verify that your order is linked to a new fund (which is linked to a new budget). 4/ Verify the constraint has correctly been added (show create table aqorders). Signed-off-by: Paola Rossi <paola.rossi@cineca.it> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I fixed the conflict. Kyle, could you take another look? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #32777|0 |1 is obsolete| | --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 33067 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=33067&action=edit [PASSED QA] Bug 12601: Add a foreign key for aqorders.budget_id When creating an order, the fund value is mandatory but the DB structure does not show this constraint. The aqorders.budget_id field should be linked to aqbudgets.budget_id. The updatedatabase.pl (entry 3.01.00.077) commented this constraint, certainly for a retro compatibility reason. Actually I found some cases (in production) where aqorders.budget_id is set to "0". To add this constraint, we should add a temporary fund to linked orphan orders. Test plan: 0/ Verify it is not possible to create an order not linked to a fund via the Koha interface. 1/ Using your SQL CLI (or equivalent), create or update 1+ orders and set "0" in the budget_id field. 2/ Execute the updatedabase script. 3/ Verify that your order is linked to a new fund (which is linked to a new budget). 4/ Verify the constraint has correctly been added (show create table aqorders). Signed-off-by: Paola Rossi <paola.rossi@cineca.it> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 33798 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=33798&action=edit k -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #33067|0 |1 is obsolete| | Attachment #33798|0 |1 is obsolete| | --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 33799 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=33799&action=edit Bug 12601: Add a foreign key for aqorders.budget_id When creating an order, the fund value is mandatory but the DB structure does not show this constraint. The aqorders.budget_id field should be linked to aqbudgets.budget_id. The updatedatabase.pl (entry 3.01.00.077) commented this constraint, certainly for a retro compatibility reason. Actually I found some cases (in production) where aqorders.budget_id is set to "0". To add this constraint, we should add a temporary fund to linked orphan orders. Test plan: 0/ Verify it is not possible to create an order not linked to a fund via the Koha interface. 1/ Using your SQL CLI (or equivalent), create or update 1+ orders and set "0" in the budget_id field. 2/ Execute the updatedabase script. 3/ Verify that your order is linked to a new fund (which is linked to a new budget). 4/ Verify the constraint has correctly been added (show create table aqorders). Signed-off-by: Paola Rossi <paola.rossi@cineca.it> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Rebased and fixed conflict in updatedatabase. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA CC| |tomascohen@gmail.com --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Please check the failing tests because of this patches: t/db_dependent/Acquisition/CancelReceipt.t t/db_dependent/Acquisition/Invoices.t t/db_dependent/Acquisition/TransferOrder.t Probably problem with tests sample data, but cannot check/fix right now. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA --- Comment #14 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Tomás Cohen Arazi from comment #13)
Please check the failing tests because of this patches:
t/db_dependent/Acquisition/CancelReceipt.t t/db_dependent/Acquisition/Invoices.t t/db_dependent/Acquisition/TransferOrder.t
Probably problem with tests sample data, but cannot check/fix right now.
It looks good here. Did you execute the updatedatabase entry? Maybe it does not worth to push this one before the release. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12601 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Jonathan! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org