Hello sir. I got this error while run upgrade from version 3.2.1.4 to 3.3.0.3
[data: dbscripts/xml/upgrade/3.2.0_versioning.xml] ERROR: Upgrade failed: DB: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'publication_id' cannot be null (SQL: UPDATE publication_formats as pf SET publication_id = ( SELECT s.current_publication_id FROM temp_publication_formats as tpf LEFT JOIN submissions as s ON (tpf.submission_id = s.submission_id) WHERE pf.publication_format_id = tpf.publication_format_id ) )
Other users have reported this error on the forum when upgrading. Hereās one example:
Try searching āPublication_id Null Upgradeā on the forum and youāll see a number of other relevant results that offer suggestions for what to try when facing this issue.
Did you try the solution on the thread linked above? After restoring the backup and before running the upgrade script, what do you get for the following database query?
SELECT pf.publication_id FROM publication_formats pf LEFT JOIN submissions s ON (pf.publication_id = s.submission_id) WHERE s.submission_id IS NULL;
Regards,
Alec Smecher
Public Knowledge Project Team
Did you try the solution on the thread linked above? >> YES
After restoring the backup and before running the upgrade script, what do you get for the following database query? SELECT pf.publication_id FROM publication_formats pf LEFT JOIN submissions s ON (pf.publication_id = s.submission_id) WHERE s.submission_id IS NULL;
Results >>1054 - Unknown column āpf.publication_idā in āfield listā,
Can you confirm whether your OMP 3.2.1-4 database (before attempting the upgrade to 3.3) has a column called publication_id in the publication_formats table? This should definitely be present.
Regards,
Alec Smecher
Public Knowledge Project Team
Then something has happened outside of OMP 3.2.1 to remove that column from your database. Either the column was removed manually, or perhaps you attempted to run an upgrade to 3.3.x that completed partially but failed. In order to upgrade from 3.2.1 to 3.3.x you need a clean database, i.e. one that has not already failed an attempted upgrade.
Regards,
Alec Smecher
Public Knowledge Project Team
DELETE FROM publication_formats WHERE publication_format_id in (SELECT pf.publication_format_id FROM publication_formats pf LEFT JOIN submissions s ON (pf.submission_id = s.submission_id) WHERE s.submission_id IS NULL);