Koha-clms/installer/data/mysql
Jan Kissig cf9211550d
Bug 42301: Fix error occuring on updatedatabase when using MySQL
This patch fixes an error when running updatedatabase on an instance using MySQL by defining a key length for an unique key. The unique key in table record_sources was introduced on 35380 but was lacking a key length which works in mariaDB but fails on MySQL.

Test plan:
a) run ktd with mysql f.e.: DB_IMAGE=mysql:8.0 ktd --proxy --name mysql8 up -d
b) enter ktd shell ktd --name mysql8 --shell
c) checkout a Koha version prior to 35380. f.e. "git checkout 67adbce6562fa352b143977747fa290f23c63fde"
d) run 'reset_all'
e) log in and check Koha version in http://mysql8-intra.localhost/cgi-bin/koha/about.pl which should show
25.12.00.036
f) git checkout main
g) restart_all
h) updatedatabase will throw the following error:
Upgrade to 25.12.00.037  [08:29:14]: Bug 35380 - Add new unique name to record sources, add default record sources, add is_system column to default record sources.
        ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: BLOB/TEXT column 'name' used in key specification without a key length at /kohadevbox/koha/C4/Installer.pm line 817
i) apply patch
j) 'updatedatabase' should run without errors now

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bcdd04c08b)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:17 +01:00
..
atomicupdate DBRev 25.11.04.006 2026-05-24 13:42:15 +01:00
db_revs Bug 42301: Fix error occuring on updatedatabase when using MySQL 2026-05-24 13:42:17 +01:00
en Bug 39532: Use new FINES restriction type to avoid conflict with SUSPENSION 2025-11-21 08:41:51 -07:00
localization Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
mandatory Bug 42318: Populate record_sources with system defined values on install 2026-05-24 13:42:17 +01:00
backfill_statistics.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
fix_unclosed_nonaccruing_fines_bug17135.pl Bug 41076: [25.11.x] Adjust perl tidiness for v20250105 2026-03-16 13:23:08 +00:00
kohastructure.sql Bug 42273: Fix 'idenfity' typo in categories table 2026-05-24 13:42:15 +01:00
labels_upgrade.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
needs_update.pl Bug 34088: Move the 'needs update' test to a separate script 2024-09-17 10:48:39 +02:00
patroncards_upgrade.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
update22to30.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
updatedatabase.pl Bug 38384: (follow-up) move require Koha::Plugins to use 2026-04-10 14:18:50 +01:00