Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-7712

Migrating from older versions to 4.0 fails when running on a PostgreSQL database during the ID migration


    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 4.0-rc-1
    • Fix Version/s: 4.0
    • Component/s: Old Core
    • Labels:
    • Difficulty:
    • Similar issues:


      Under PostgreSQL, hibernate introduce foreign key constrains between the BaseProperty class and property subclasses. This cause the migration to break on IDs updates, starting with the xwikidates table.

      To fix this, we have 3 options:

      1. remove all foreign key constrains on all subclasses table, using liquibase in the same migration, since liquibase is runned before
      2. same as 1. but introduce new key constrains using the onUpdate="CASCADE" options, so we get cascaded upgrades
      3. same as 1., then proceed to migration, and later reintroduce the constrains

      3. is not easy, since we have liquibase before but not after migration, this would involve the creation of a second migration, and this is not good to split migration that way. 1. is easy, but maybe a little bit lazy.
      Currently, the plan is therefore to try to apply 2, and skip during the migration the tables that will be automatically updated by the cascade.

      The same issue may affect other supported databases. Since the plan is to introduce the liquibase operations with a precondition on postgreSQL, and to also skip some migration based on the database product name, these will not be fixed until we also add the same conditions for them.


          Issue Links



              • Assignee:
                sdumitriu Sergiu Dumitriu
                softec Denis Gervalle
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created:
                  Date of First Response: