I am upgrading DHIS2 system to 2.32.6 and have error I can not find solution for

I am upgrading DHIS2 system from 2.29 to the latest. at 2.32.6 stem I’ve got this error and can not find any solution. please help!.

SQL State : 0A000
Error Code : 0
Message : ERROR: cannot alter type of a column used in a trigger definition
Detail: trigger datavalue_audit_update on table datavalue depends on column “periodid”
Location : org/hisp/dhis/db/migration/2.32/V2_32_10__Use_bigint_for_id_columns.sql (/file:/home/dhis/tomcat-dhis/webapps/ROOT/WEB-INF/lib/dhis- support-db-migration-2.33.5.jar!/org/hisp/dhis/db/migration/2.32/V2_32_10__Use_bigint_for_id_columns.sql)
Line : 266
Statement : alter table datavalue alter column periodid type bigint

1 Like

Hi @TatianaLar1,

Did you upgrade from 2.29 to 2.30 and then upgrade further? It’s only after 2.30 you can upgrade directly to the version you want to upgrade because of Flyway.

Also tagging @Ameen to have a closer look. :slight_smile:

1 Like

Hi @TatianaLar1
It looks like there is a database trigger that is setup on a table/column. This table/column is being updated in the migration, but due to the presence of the trigger it fails.
If you can drop/remove the database trigger before deploying the application and let the migration run successfully, and after the migration you can recreate the same trigger as you want.
Let us know how it goes!