We use an automated system to validate the changesets using the liquibase diff command.
This works very well, only that H2 seems to rename its primary key indices on every alter table command, which results in error messages as the following:
- Missing Indexes:
PRIMARY_KEY_55 on DAT_APPLICATION_BLOCKS(X_PPLCTNSQNC_RGSTRDS_D, X_PPLCTNSQNC_SQNCNMBR, BLOCKNUMBER)
PRIMARY_KEY_31 on DAT_GAP_FORMULATIONS(ID)
Unexpected Indexes:
PRIMARY_KEY_CE on DAT_APPLICATION_BLOCKS(X_PPLCTNSQNC_RGSTRDS_D, X_PPLCTNSQNC_SQNCNMBR, BLOCKNUMBER)
PRIMARY_KEY_282 on DAT_GAP_FORMULATIONS(ID)
So the liquibase diff detects (correctly) that the primary key name changed. This can be fixed by adding a drop Index and add Index manually in the changeset.
Is there a way to tell liquibase to re-create the primary key index after every alter table, or any other workaround?