Database error while upgrading OJS from 3.1.1.4 to 3.3.0.5

I am trying to upgrade OJS from 3.1.1.4 to 3.3.0.5. While upgrading, it is showing this database error, as I have dropped the dataset and re-created it. Then uploaded the database from the backup (before 1st upgrade), but still facing the issue. This time it is showing the following error.

A database error has occurred: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table `submission_file_revisions` add constraint `submission_file_revisions_submission_file_id_foreign` foreign key (`submission_file_id`) references `submission_files` (`submission_file_id`))

Please Guide.

Hi @loveleentak

For OJS 3.3, all database tables need to be of type InnoDB, not MyISAM. You’ll need to review your tables in your 3.1.1.4 database and ensure this is the case, and then make sure that the default storage engine for MySQL is InnoDB. You will also need to make sure that your database user has the REFERENCES privilege.

Best
Jason

2 Likes

Thank you. This has worked for me.

1 Like