Description
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:
- remove all foreign key constrains on all subclasses table, using liquibase in the same migration, since liquibase is runned before
- same as 1. but introduce new key constrains using the onUpdate="CASCADE" options, so we get cascaded upgrades
- 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.
Attachments
Issue Links
- is related to
-
XWIKI-7729 IDs migration fails due to foreign key constraints
- Closed