https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33671 --- Comment #18 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Pablo AB from comment #17)
SELECT version()\G version(): 10.1.41-MariaDB-0+deb9u1
I would recommend to upgrade your MariaDB server to the level that would be normal for Debian 11. This is older.
SELECT * FROM borrower_relationships; Empty set (0.000 sec)
So there should be really no harm in adding a FK.
SHOW CREATE TABLE borrower_relationships\G *************************** 1. row *************************** Table: borrower_relationships Create Table: CREATE TABLE `borrower_relationships` ( `id` int(11) NOT NULL AUTO_INCREMENT, `guarantor_id` int(11) DEFAULT NULL, `guarantee_id` int(11) NOT NULL, `relationship` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `guarantor_guarantee_idx` (`guarantor_id`,`guarantee_id`), KEY `r_guarantee` (`guarantee_id`), CONSTRAINT `r_guarantee` FOREIGN KEY (`guarantee_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `r_guarantor` FOREIGN KEY (`guarantor_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
This looks perfectly fine. Could you test this on the mysql command line too: ALTER TABLE borrower_relationships CHANGE COLUMN guarantor_id guarantor_id int(11) NOT NULL And revert again with: ALTER TABLE borrower_relationships CHANGE COLUMN guarantor_id guarantor_id int(11) DEFAULT NULL What is the error message, code ? It would not surprise me if it would not fail for a higher MariaDB ? -- You are receiving this mail because: You are watching all bug changes.