Created attachment 1087251 [details] Dump to use on your tests * Description of problem: Using the database dump attached I ran the migration script [1] I the error [2] was shown. [1] - https://github.com/droolsjbpm/jbpm/blob/master/jbpm-installer/db/upgrade-scripts/postgresql/bpms-6.0-to-6.1.sql [2] - ERROR: null value in column "id" violates not-null constraint SQL state: 23502 * Version-Release number of selected component (if applicable): I was migrating from 6.0.3 to 6.1.3 using Postgres 9.2 * How reproducible: You don't need Jboss BPMS to reproduce this. Just install Postgres 9.2 * Steps to Reproduce: On Postgres 9.2: - Create a database; - Import the dump attached; - Try execute the whole upgrade script. * Actual results: ERROR: null value in column "id" violates not-null constraint SQL state: 23502 * Expected results: No errors * Additional info: As a workaround I changed the script, to link the id column (from the table AuditTaskImpl) to the sequence AUDIT_ID_SEQ (See [3]). But I'm not sure if this is the best approach. If the persistence source code is putting the sequence using Hibernate this change which I made could lead to problems. Better have an official solution to this from the experts. -> Point of attention: In this change I placed single quotes in the nextval call but I got reports from people having the error because of this. So, if you got an error like [4] try remove the quote or put double quotes. [3] - ... create table AuditTaskImpl ( id int8 DEFAULT nextval('AUDIT_ID_SEQ') not null, ... [4] - ERROR: relation “audit_id_seq” does not exist SQL state: 42P01
Thank you Alexandre. I was able to reproduce the issue. Instead of using the sequence directly in the table definition the best should be using nextval in the INSERT statement to avid any problem with Hibernate. I just created the PR bellow for Postgres and Oracle: https://github.com/droolsjbpm/jbpm/pull/320/files
master: http://github.com/droolsjbpm/jbpm/commit/401509ab9 6.3.x: http://github.com/droolsjbpm/jbpm/commit/e77d9c57d
Verified in 6.2.0.CR1. The upgrade scripts from supplementary tools passed correctly and table AuditTaskImpl is filled with values. I used the attached PostgreSQL dump.