In 24.11 the system complains about a FK constraint to the new oai tables when the script is run with -a -d. DBI Exception: DBD::mysql::db do failed: Cannot truncate a table referenced in a foreign key constraint (`koha_xxx`.`import_oai_authorities`, CONSTRAINT `FK_import_oai_authorities_1` FOREIGN KEY (`authid`) REFERENCES `koha_dlre1`.`auth_header` (`authid`)) at /usr/share/perl5/DBIx/Class/Schema.pm line
Created attachment 187852 [details] [review] Bug 41008: Fix bulkmarimport.pl -a -d After bug 35659 that added the OAI harvester to Koha the -d switch for deleting authorities before importing with bulkmarcimport.pl was broken and resulted in a FK error. Switching from truncate to DELETE FROM like we already did for items, biblio etc. fixes the issue. To test: - Make sure you have some authorities in your database - Export some into a file for importing - Run bulkmarcimport -a -d --file <filename> - Verify you get the a DB FK constraint error. - Apply patch - Repeat steps, verify the script now works as expected again * Existing authorities are deleted * File is imported
I'll take a look at this soon