[Bug 30483] New: Should issues.borrowernumber and issues.itemnumber be NOT NULL ?
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 Bug ID: 30483 Summary: Should issues.borrowernumber and issues.itemnumber be NOT NULL ? Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Database Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org Sync problem between structure and dbrevs. For old prod databases only (that passed the 3.05 dbrevs) Note that I did not expect such a difference in a vital table like issues ! update $DBversion = "3.05.00.009"; $dbh->do("ALTER TABLE issues MODIFY COLUMN borrowernumber int(11) NOT NULL"); $dbh->do("ALTER TABLE issues MODIFY COLUMN itemnumber int(11) NOT NULL"); Current structure allows them to be NULL. I wonder if that is correct. An issue should have a borrower and an item, right? -- 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=30483 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.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=30483 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |30486 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30486 [Bug 30486] [OMNIBUS] Synchronize database schema with (older) database revisions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 133079 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=133079&action=edit Bug 30483: Make issues.borrowernumber and itemnumber NOT NULL Note: This change does NOT apply to old_issues, where constraints may result in nullifying these columns. Test plan: Run dbrev. Try checkout, checkin. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 133080 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=133080&action=edit Bug 30483: DBIx changes for issues table Note: You may observe that DBIx drops the LEFT join_type here. There is no reason to be worried about that. If a FK column allows NULL values, DBIx sets it to LEFT. We remove the NULL here and DBIx now defaults to INNER again. No test plan. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 139195 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139195&action=edit Bug 30483: (DBIx schema) Changes to Issue.pm Compare with results of update_dbix_class_files.pl. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #133080|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Should |Do not allow NULL in |issues.borrowernumber and |issues.borrowernumber and |issues.itemnumber be NOT |issues.itemnumber |NULL ? | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Note: You may observe that DBIx drops the LEFT join_type here. There is no reason to be worried about that. If a FK column allows NULL values, DBIx sets it to LEFT. We remove the NULL here and DBIx now defaults to INNER again. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Note from a discussion on IRC: We do not anonymize active issues. So no problem there. And if we mark an item as lost but not returned, the issue should still have an itemnumber and a borrowernumber. So no problem too. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #133079|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 139682 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139682&action=edit Bug 30483: Make issues.borrowernumber and itemnumber NOT NULL Note: This change does NOT apply to old_issues, where constraints may result in nullifying these columns. Test plan: Run dbrev. Try checkout, checkin. 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=30483 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139195|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 139683 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139683&action=edit Bug 30483: (DBIx schema) Changes to Issue.pm Compare with results of update_dbix_class_files.pl. 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=30483 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |martin.renvoize@ptfs-europe | |.com --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Makes sense to me.. Signing off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joonas.kylmala@iki.fi QA Contact|testopia@bugs.koha-communit |joonas.kylmala@iki.fi |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 Joonas Kylmälä <joonas.kylmala@iki.fi> 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=30483 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139682|0 |1 is obsolete| | Attachment #139683|0 |1 is obsolete| | --- Comment #9 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 139924 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139924&action=edit Bug 30483: Make issues.borrowernumber and itemnumber NOT NULL Note: This change does NOT apply to old_issues, where constraints may result in nullifying these columns. Test plan: Run dbrev. Try checkout, checkin. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 --- Comment #10 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 139925 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139925&action=edit Bug 30483: (DBIx schema) Changes to Issue.pm Compare with results of update_dbix_class_files.pl. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00 |22.11.00, 22.05.07 released in| | CC| |lucas@bywatersolutions.com Status|Pushed to master |Pushed to stable --- Comment #12 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for upcoming 22.05.07 release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |victor@tuxayo.net Status|Pushed to stable |RESOLVED --- Comment #13 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document it seems, marking resolved. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |32399 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32399 [Bug 32399] Database update for bug 30483 is failing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Follow-up on bug 32399 to prevent failures. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 tony-the-hawk <antonio.falco@unito.it> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |antonio.falco@unito.it -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 Pablo López Liotti <paliotti@mdp.edu.ar> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paliotti@mdp.edu.ar --- Comment #15 from Pablo López Liotti <paliotti@mdp.edu.ar> --- Hi, I'm upgrading a Koha 21.05 in Debian 9.5 to Koha 22.05. After I do command line upgrade of koha-common, the intranet shows web install. Here, in tables structure update, the process stop with this message: Updating database structure Update errors : Upgrade to 22.05.06.001 [13:31:19]: Bug 30483 - Make issues.borrowernumber and itemnumber NOT NULL ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Cannot change column 'borrowernumber': used in a foreign key constraint 'issues_ibfk_1' at /usr/share/koha/lib/C4/Installer.pm line 739 Now, what can I do? Thks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30483 --- Comment #16 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Pablo López Liotti from comment #15)
Hi, I'm upgrading a Koha 21.05 in Debian 9.5 to Koha 22.05.
After I do command line upgrade of koha-common, the intranet shows web install. Here, in tables structure update, the process stop with this message:
Updating database structure Update errors :
Upgrade to 22.05.06.001 [13:31:19]: Bug 30483 - Make issues.borrowernumber and itemnumber NOT NULL ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Cannot change column 'borrowernumber': used in a foreign key constraint 'issues_ibfk_1' at /usr/share/koha/lib/C4/Installer.pm line 739
Now, what can I do? Thks
See bug 32399. There is a fix. And it should have been pushed already to 22.05. But somehow it wasnt. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org