Uploaded image for project: 'JBoss BPMS Platform'
  1. JBoss BPMS Platform
  2. RHBPMS-4235

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

    XMLWordPrintable

Details

    Description

      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:

      Attachments

        Issue Links

          Activity

            People

              kverlaen@redhat.com Kris Verlaenen
              lpetrovi@redhat.com Lukáš Petrovický (Inactive)
              Jakub Schwan Jakub Schwan
              Jakub Schwan Jakub Schwan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: