CREATE TABLE `aqbudgets` ( [etc] CONSTRAINT `aqbudgetperiods_ibfk_1` FOREIGN KEY (`budget_period_id`) REFERENCES `aqbudgetperiods` (`budget_period_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; Normally, our constraints have the prefix showing the source table not the destination (aqbudgetperiods) like here. DBrev20.06.00.055 contained this: if ( !foreign_key_exists( 'aqbudgets', 'aqbudgetperiods_ibfk_1' ) ) { $dbh->do(q| ALTER TABLE aqbudgets ADD CONSTRAINT `aqbudgetperiods_ibfk_1` FOREIGN KEY (`budget_period_id`) REFERENCES `aqbudgetperiods` (`budget_period_id`) ON UPDATE CASCADE ON DELETE CASCADE |); This created aqbudgetperiods_ibfk_1 next to aqbudgets_ifbk_1 that we already had in our production table. Note that DBrev 3.01.00.077 already contained that one: ALTER TABLE `aqbudgets` ADD CONSTRAINT `aqbudgets_ifbk_1` FOREIGN KEY (`budget_period_id`) REFERENCES `aqbudgetperiods` (`budget_period_id`) ON DELETE CASCADE ON UPDATE CASCADE Conclusion: Older Koha database may contain a duplicated FK constraint.