See also $DBversion = '19.06.00.022'; CREATE TABLE `borrower_relationships` [...] guarantor_id INT(11) NOT NULL, guarantee_id INT(11) NOT NULL, Many production db's will have both fields already NOT NULL. We need to adjust kohastructure and DBIx Note that non-patron guarantors are NOT saved in this table but in the borrowers table itself IIUC.
Created attachment 139711 [details] [review] Bug 30472: Make borrower_relationships.guarantor_id not null In harmony with dbrev 19.06.00.022. Test plan: Run dbrev. Run t/db_dependent/Patron/Relationships.t Run t/db_dependent/Koha/Patrons.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Trivial, architectural (db admin). Self signoff.
RM: Take care of DBIx please.
Created attachment 139972 [details] [review] Bug 30472: Make borrower_relationships.guarantor_id not null In harmony with dbrev 19.06.00.022. Test plan: Run dbrev. Run t/db_dependent/Patron/Relationships.t Run t/db_dependent/Koha/Patrons.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Makes perfect sens. Generated DBIx looks OK.
(In reply to Fridolin Somers from comment #4) > Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Thanks.
Pushed to master for 22.11. Nice work everyone, thanks!
Upgrading to 22.11.02-1 from an updated 22.05 on a Debian 11: Upgrade to 22.06.00.048 [18:33:27]: Bug 30472 - borrower_relationships.guarantor_id NOT NULL ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Cannot change column 'guarantor_id': used in a foreign key constraint 'r_guarantor' at /usr/share/koha/lib/C4/Installer.pm line 739 Maybe the same issue as on bug 32399?
Hello. While upgrading from 22.05 to 22.11 we are running into the following problem that is related to this change: "Upgrade to 22.06.00.048 [20:19:53]: Bug 30472 - borrower_relationships.guarantor_id NOT NULL ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Cannot change column 'guarantor_id': used in a foreign key constraint 'r_guarantor' at /usr/share/koha/lib/C4/Installer.pm line 743" Is there any workaround? What can we do to get the upgrade working?
Hi Mona, hi Pablo, I've moved the problem into a new bug: bug 33671. What you can do: could you check if you have NULL values in borrower_relationships.guarantor_id? Also, which DBMS are you using and what is the version? (MariaDB or MySQL, check the about page in Koha) Please add info to bug 33671. Thx!