https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37000

Emily Lamancusa <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Passed QA                   |Failed QA
                 CC|                            |emily.lamancusa@montgomeryc
                   |                            |ountymd.gov

--- Comment #4 from Emily Lamancusa <[email protected]> ---
Sorry, this doesn't completely fix the issue for production environments using
MySQL. If strict_mode is off, MySQL won't allow you to change a nullable column
to non-nullable if the column has a foreign key, even if there are no existing
null values in the data. (see
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35687#c13)

I was able to reproduce the error, even with this patch applied, with the
following steps:
1. Shut down KTD
2. Switch to 23.11.x
3. Start up KTD with MySQL-8 (I did this using the built-in alias ku-my8)
4. Inside a kshell, edit /etc/koha/sites/kohadev/koha-conf.xml. Set
<strict-sql-modes> to 0.
5. Switch to main and apply patch
6. restart_all
7. updatedatabase
--> observe the original error

Can the foreign key be added at the end of the dbrev, after the NOT NULL
constraint is set, instead of the beginning? items.homebranch and
items.holdingbranch already have a FK referencing branches.branchcode
themselves, so it should be safe to fill in those values and add the new FK
after.

Incidentally, if I ran the database update a second time immediately after the
first, the database appeared to successfully complete the update to 24.05;
however, this dbrev silently did nothing because the pickup_library_id column
already exists, and the foreign key never got added.

Will upload a follow-up patch in a bit that I believe will address both of
these issues...

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to