Upgrade from OJS 3.2.1-4 to OJS 3.3.0-3 fails. PDOException ... Can't create table ... Foreign key constraint is incorrectly formed

Thanks @Vitaliy for bringing this to my attention. I have applied this fix and now and I can confirm that it works! I can now successfully upgrade the larger OJS database using InnoDB engine, where the previous upgrade attempt failed due to the error:

ERROR: Upgrade failed: DB: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (journals_stage.#sql-500_219b, CONSTRAINT review_files_submission_file_id_foreign FOREIGN KEY (submission_file_id) REFERENCES submission_files (submission_file_id)) in /var/www/vhosts/journals-stage.oslomet.no-ojs-3.3.0-3/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:115

2 Likes