[Bug 38011] New: Add a foreign key link between vendors and subscriptions
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Bug ID: 38011 Summary: Add a foreign key link between vendors and subscriptions Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: matt.blenkinsop@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org There is a FIXME to add a foreign key between vendors and subscriptions -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 --- Comment #1 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 171971 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171971&action=edit Bug 38011: Add a foreign key between vendors and subscriptions Test plan: prove t/db_dependent/Koha/Subscription.t -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |38010 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38010 [Bug 38010] Migrate vendors to Vue -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171971|0 |1 is obsolete| | --- Comment #2 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 171972 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171972&action=edit Bug 38011: Add a foreign key between vendors and subscriptions Test plan: prove t/db_dependent/Koha/Subscription.t -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |matt.blenkinsop@ptfs-europe |ity.org |.com CC| |phil@chetcolibrary.org -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com Blocks| |5334 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5334 [Bug 5334] Omnibus: Add explicit foreign key constraints -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |roadmap_24_11 CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- The tests failed for me (using KTD). If I don't run the databaseupdate, the tests pass: prove t/db_dependent/Koha/Subscription.t t/db_dependent/Koha/Subscription.t .. ok All tests successful. Files=1, Tests=10, 2 wallclock secs ( 0.01 usr 0.00 sys + 1.32 cusr 0.39 csys = 1.72 CPU) Result: PASS If I do a databaseupdate and restart everything, the tests fail: prove t/db_dependent/Koha/Subscription.t t/db_dependent/Koha/Subscription.t .. 1/10 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`subscription`, CONSTRAINT `subscription_ibfk_4` FOREIGN KEY (`aqbooksellerid`) REFERENCES `aqbooksellers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE) at /kohadevbox/koha/Koha/Object.pm line 172 # No tests run! # Failed test 'No tests run for subtest "Koha::Subscription->biblio"' # at t/db_dependent/Koha/Subscription.t line 49. Broken FK constraint# Looks like your test exited with 255 just after 2. t/db_dependent/Koha/Subscription.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 9/10 subtests Test Summary Report ------------------- t/db_dependent/Koha/Subscription.t (Wstat: 65280 (exited 255) Tests: 2 Failed: 1) Failed test: 2 Non-zero exit status: 255 Parse errors: Bad plan. You planned 10 tests but ran 2. Files=1, Tests=2, 2 wallclock secs ( 0.02 usr 0.01 sys + 0.92 cusr 0.17 csys = 1.12 CPU) Result: FAIL Am I supposed to run the databaseupdate? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171972|0 |1 is obsolete| | --- Comment #4 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 173859 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173859&action=edit Bug 38011: Add a foreign key between vendors and subscriptions Test plan: prove t/db_dependent/Koha/Subscription.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 --- Comment #5 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Missed something from the DB update file that I had in a forgotten commit in my local branch - added that back in and it should work now! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #173859|0 |1 is obsolete| | --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 173860 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173860&action=edit Bug 38011: Add a foreign key between vendors and subscriptions Test plan: prove t/db_dependent/Koha/Subscription.t Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |38389 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38389 [Bug 38389] Add 'subscriptions' embed to vendors endpoint -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #173860|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 174180 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174180&action=edit Bug 38011: Add a foreign key between vendors and subscriptions Test plan: prove t/db_dependent/Koha/Subscription.t prove t/db_dependent/Koha/Acquisition/Booksellers.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 --- Comment #8 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 174181 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174181&action=edit Bug 38011: Schema update Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 --- Comment #9 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 174182 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174182&action=edit Bug 38011: (QA follow-up) Additional unit tests Add an additional unit test for the default null on the new constraint. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 --- Comment #10 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 174183 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174183&action=edit Bug 38011: (QA follow-up) Improve database update This patch ensure's we fix errant values in subscriptions prior to adding the foreign key constraint. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #174180|0 |1 is obsolete| | Attachment #174181|0 |1 is obsolete| | Attachment #174182|0 |1 is obsolete| | Attachment #174183|0 |1 is obsolete| | --- Comment #11 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 174185 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174185&action=edit Bug 38011: Add a foreign key between vendors and subscriptions Test plan: prove t/db_dependent/Koha/Subscription.t prove t/db_dependent/Koha/Acquisition/Booksellers.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Amended-by: Jonathan Druart Rename $rs Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 --- Comment #12 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 174186 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174186&action=edit Bug 38011: Schema update Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 --- Comment #13 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 174187 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174187&action=edit Bug 38011: (QA follow-up) Additional unit tests Add an additional unit test for the default null on the new constraint. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 --- Comment #14 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 174188 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174188&action=edit Bug 38011: (QA follow-up) Improve database update This patch ensure's we fix errant values in subscriptions prior to adding the foreign key constraint. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |38390 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38390 [Bug 38390] Add 'subscriptions+count' embed to vendors endpoint -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |jonathan.druart@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|roadmap_24_11 |additional_work_needed --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- The nice output is not so nice when you have no subscriptions to update: Updated 0E0 subscriptions with NULL aqbooksellerid where aqbooksellerid was not found in aqbooksellers -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Acquisitions |Architecture, internals, | |and plumbing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 --- Comment #17 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- (In reply to Katrin Fischer from comment #15)
The nice output is not so nice when you have no subscriptions to update:
Updated 0E0 subscriptions with NULL aqbooksellerid where aqbooksellerid was not found in aqbooksellers
0E0 is the 'non-error' zero for DBI.. it needs catching explicitly.. I've done a few updates where that's the case. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 --- Comment #18 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 174397 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174397&action=edit Bug 38011: (QA follow-up) Improve database update output Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |**Sponsored by** *PTFS release notes| |Europe* and *ByWater | |Solutions* -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | --- Comment #19 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Follow-up picked for main - thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 --- Comment #20 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 --- Comment #21 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 174492 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174492&action=edit Bug 38011: Fix ReNewSubscription.t t/db_dependent/Serials/ReNewSubscription.t .. Value not allowed for auto_incr id in Aqbookseller at /kohadevbox/koha/t/lib/TestBuilder.pm line 402. Null value for subscriptionid in Subscriptionhistory not allowed at /kohadevbox/koha/t/lib/TestBuilder.pm line 415. Can't call method "enddate" on an undefined value at t/db_dependent/Serials/ReNewSubscription.t line 102. It's failing when no vendor with id=1 in DB. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | --- Comment #22 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Picked follow-up for main. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18745 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to main |Needs documenting -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|38010 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38010 [Bug 38010] Migrate vendors to Vue -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38011 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs documenting |RESOLVED --- Comment #23 from David Nind <david@davidnind.com> --- Bug fix, and updates to tests. No changes required to the manual. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org