Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-4768

SQL upgrade scripts - changing SessionInfo primary key column data type fails

XMLWordPrintable

      In database upgrade scripts, which are located in jbpm-installer module, we update data type of primary key column "id" of "SessionInfo" table. It's script jbpm-6.1-to-6.2.sql. Some database systems can do this update, but some others not.

      E.g. in SQL Server you must first drop the primary key constraint from the column and after data type change, create it again. But the constraint can be dropped only if there are no foreign key references referencing the column. So when there is a lot of data, this can be a problem.

      I'm creating this because I cannot find a "clear" solution for this case. An idea was to disable constraints temporarily, drop primary key constraint, make the data type change, enable constraints. But this can be risky, because when something fails, constraints can remain disabled.

      Tested databases where it fails:

      • SQL Server 2012
      • DB2 10.1

      Reproducer:

              kverlaen@redhat.com Kris Verlaenen
              tzimanyi@redhat.com Tibor Zimányi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: