OJS Error updating 3.1.2.1 to 3.2.1 postgres 12

Hi all,
I get the same error as of this post:

I don’t understand how to update the tables with correct values, is there a better solution to solve this?

Output from upgrade:
[pre-install]
[load: upgrade.xml]
[version: 3.2.1.0]

[code: Installer Installer::checkPhpVersion]

[code: Installer Installer::migrateSubmissionCoverImages]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_email_templates.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_versioning_articleGalleySettings.xml (skipped)]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_versioning.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_last_activity.xml]
[data: dbscripts/xml/upgrade/3.2.1_preupdate_subeditor_categories.xml]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/log.xml]
[schema: lib/pkp/xml/schema/announcements.xml]
[schema: lib/pkp/xml/schema/scheduledTasks.xml]
[schema: lib/pkp/xml/schema/temporaryFiles.xml]
[schema: lib/pkp/xml/schema/metadata.xml]
[schema: lib/pkp/xml/schema/reviews.xml]
[schema: lib/pkp/xml/schema/reviewForms.xml]
[schema: lib/pkp/xml/schema/controlledVocab.xml]
[schema: lib/pkp/xml/schema/submissions.xml]
[schema: lib/pkp/xml/schema/submissionFiles.xml]
[schema: lib/pkp/xml/schema/categories.xml]
[schema: lib/pkp/xml/schema/notes.xml]
[schema: lib/pkp/xml/schema/genres.xml]
[schema: lib/pkp/xml/schema/tombstone.xml]
[schema: lib/pkp/xml/schema/rolesAndUserGroups.xml]
[schema: lib/pkp/xml/schema/metrics.xml]
[schema: lib/pkp/xml/schema/views.xml]
[schema: lib/pkp/xml/schema/libraryFiles.xml]
[schema: lib/pkp/xml/schema/navigationMenus.xml]
[schema: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]

[code: Installer Installer::installDefaultNavigationMenus]
WARNING: The NavigationMenu (ContextId: 1, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 1, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 0, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.

[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]

[code: Installer Installer::migrateUserAndAuthorNames (skipped)]
[data: dbscripts/xml/upgrade/3.2.0_stylesheet.xml]
[data: dbscripts/xml/upgrade/3.2.0_archiving_settings.xml]
[data: dbscripts/xml/upgrade/3.2.0_update.xml]
[data: dbscripts/xml/upgrade/3.2.0_navigation_menu_items_locale_change.xml]

[code: Installer Installer::migrateSiteLocales]

[code: Installer Installer::migrateSidebarBlocks]

[code: Installer Installer::migrateSiteStylesheet]

[code: Installer Installer::migrateMetadataSettings]

[code: Installer Installer::createLicenseTerms]
PHP Fatal error: Uncaught Exception: DB Error: ERROR: null value in column “setting_type” violates not-null constraint
DETAIL: Failing row contains (1, en_US, licenseTerms, Authors who publish with this journal agree to the following ter…, null). Query:
INSERT INTO journal_settings (
journal_id,
locale,
setting_name,
setting_value
) VALUES (?, ?, ?, ?) in /var/www/html/ojs/lib/pkp/classes/db/DAO.inc.php:703
Stack trace:
#0 /var/www/html/ojs/lib/pkp/classes/db/DAO.inc.php(231): DAO->handleError(Object(ADODB_postgres8), ‘\n\t\t\t\tINSERT INT…’)
#1 /var/www/html/ojs/classes/install/Upgrade.inc.php(2975): DAO->update(‘\n\t\t\t\tINSERT INT…’, Array)
#2 /var/www/html/ojs/lib/pkp/classes/install/Installer.inc.php(417): Upgrade->createLicenseTerms(Object(Upgrade), Array)
#3 /var/www/html/ojs/lib/pkp/classes/install/Installer.inc.php(263): Installer->executeAction(Array)
#4 /var/www/html/ojs/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#5 /var/www/html/ojs/lib/pkp/c in /var/www/html/ojs/lib/pkp/classes/db/DAO.inc.php on line 703

email_templates content before upgrade:
email_id | email_key | assoc_type | assoc_id | enabled
----------±-------------------------------------------±-----------±---------±--------
1 | SUBMISSION_UNSUITABLE | 256 | 1 | 0
2 | COPYEDIT_ACK | 256 | 1 | 0
3 | COPYEDIT_AUTHOR_ACK | 256 | 1 | 0
4 | COPYEDIT_AUTHOR_COMPLETE | 256 | 1 | 0
5 | COPYEDIT_AUTHOR_REQUEST | 256 | 1 | 0
6 | COPYEDIT_COMPLETE | 256 | 1 | 0
7 | COPYEDIT_FINAL_ACK | 256 | 1 | 0
8 | COPYEDIT_FINAL_COMPLETE | 256 | 1 | 0
9 | COPYEDIT_FINAL_REQUEST | 256 | 1 | 0
10 | COPYEDIT_REQUEST | 256 | 1 | 0
11 | EDITOR_ASSIGN | 256 | 1 | 0
12 | LAYOUT_ACK | 256 | 1 | 0
13 | LAYOUT_COMPLETE | 256 | 1 | 0
14 | LAYOUT_REQUEST | 256 | 1 | 0
15 | LUCENE_ARTICLE_INDEXING_ERROR_NOTIFICATION | 256 | 1 | 0
16 | LUCENE_JOURNAL_INDEXING_ERROR_NOTIFICATION | 256 | 1 | 0
17 | LUCENE_SEARCH_SERVICE_ERROR_NOTIFICATION | 256 | 1 | 0
18 | SUBMISSION_ACK_NOT_USER | 256 | 1 | 0
19 | SUBMISSION_ACK | 256 | 1 | 1
20 | REVIEW_REQUEST_SUBSEQUENT | 256 | 1 | 0
21 | REVIEW_REQUEST_ONECLICK_SUBSEQUENT | 256 | 1 | 0
22 | REVIEW_REQUEST_ONECLICK | 256 | 1 | 0
23 | REVIEW_REQUEST | 256 | 1 | 0
24 | REVIEW_DECLINE | 256 | 1 | 0
25 | REVIEW_CONFIRM | 256 | 1 | 0
26 | REVIEW_COMPLETE | 256 | 1 | 0
27 | REVIEW_CANCEL | 256 | 1 | 0
28 | REVIEW_ACK | 256 | 1 | 0
29 | PROOFREAD_REQUEST | 256 | 1 | 0
30 | PROOFREAD_LAYOUT_REQUEST | 256 | 1 | 0
31 | PROOFREAD_LAYOUT_COMPLETE | 256 | 1 | 0
32 | PROOFREAD_LAYOUT_ACK | 256 | 1 | 0
33 | PROOFREAD_COMPLETE | 256 | 1 | 0
34 | PROOFREAD_AUTHOR_REQUEST | 256 | 1 | 0
35 | PROOFREAD_AUTHOR_COMPLETE | 256 | 1 | 0
36 | PROOFREAD_AUTHOR_ACK | 256 | 1 | 0
37 | PROOFREAD_ACK | 256 | 1 | 0

Many thanks in advance!
Best regrads
Marcus

I apologize so much for posting when I did not need to.
For some reason did I not scroll down on the above mentioned post,
but of cause there was the answer to all my problems.

Just for reference, here is what I did:

ALTER TABLE journal_settings ALTER COLUMN setting_type DROP NOT NULL;
ALTER TABLE author_settings ALTER COLUMN setting_type DROP NOT NULL;

After this the upgrade went fine!

Thanks a lot!

1 Like