Bug 34516: Upgrade database fails for 22.11.07.003, points to web installer
authorKevin Carnes <kevin.carnes@ub.lu.se>
Mon, 27 Nov 2023 08:40:55 +0000 (09:40 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 12 Dec 2023 07:33:42 +0000 (21:33 -1000)
commitb07a87ae43f578c30e752933e9ad5a5a8871fd73
tree2803376da409807894e9c074741cd95900c4d53e
parent32eccd89749d6fa3f5d71cc01be79c00dda0dddf
Bug 34516: Upgrade database fails for 22.11.07.003, points to web installer

MySQL requires key length for indexes of text columns, while MariaDB
sets it automatically for utf8mb4.

Test plan:
1. Setup Koha to use MySQL (e.g. ku-my8)
2. Downgrade database with the following commands (e.g. koha-mysql
   kohadev):
   ALTER TABLE `biblioitems` MODIFY COLUMN `publishercode` varchar(255);
   ALTER TABLE `biblioitems` DROP INDEX `publishercode`;
   ALTER TABLE `biblioitems` ADD INDEX `publishercode` (`publishercode`);
   ALTER TABLE `deletedbiblioitems` MODIFY COLUMN `publishercode` varchar(255);
   ALTER TABLE `deletedbiblioitems` DROP INDEX `publishercode`;
   ALTER TABLE `deletedbiblioitems` ADD INDEX `publishercode` (`publishercode`);
   UPDATE systempreferences SET value="23.0600006" WHERE variable = "Version";
3. Attempt to upgrade the database (e.g. koha-upgrade-schema kohadev)
4. Notice the error about "key specification without a key length"
5. Apply patch
6. Attempt to upgrade the database (e.g. koha-upgrade-schema kohadev)
7. Notice that the database is upgraded
8. Sign off

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Perltidied the database update file.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4c6517767a86947361b81e0f718ec3833c5d5a33)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
installer/data/mysql/db_revs/230600007.pl