Merge pull request #3366 from hmlnarik/KEYCLOAK-3698
KEYCLOAK-3698 Manual migration - custom JpaEntityProvide changelog table
This commit is contained in:
commit
6f43c1f09f
1 changed files with 3 additions and 6 deletions
|
@ -85,12 +85,7 @@ public class LiquibaseJpaUpdaterProvider implements JpaUpdaterProvider {
|
|||
Liquibase liquibase = getLiquibaseForKeycloakUpdate(connection, defaultSchema);
|
||||
if (file != null) {
|
||||
exportWriter = new FileWriter(file);
|
||||
List<ChangeSet> changeSets = getChangeSets(liquibase);
|
||||
if (! changeSets.isEmpty() && liquibase.getDatabase().getRanChangeSetList().isEmpty()) {
|
||||
outputChangeLogTableCreationScript(liquibase, exportWriter);
|
||||
}
|
||||
}
|
||||
|
||||
updateChangeSet(liquibase, liquibase.getChangeLogFile(), exportWriter);
|
||||
|
||||
// Run update for each custom JpaEntityProvider
|
||||
|
@ -118,7 +113,6 @@ public class LiquibaseJpaUpdaterProvider implements JpaUpdaterProvider {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
protected void updateChangeSet(Liquibase liquibase, String changelog, Writer exportWriter) throws LiquibaseException, IOException {
|
||||
List<ChangeSet> changeSets = getChangeSets(liquibase);
|
||||
if (!changeSets.isEmpty()) {
|
||||
|
@ -134,6 +128,9 @@ public class LiquibaseJpaUpdaterProvider implements JpaUpdaterProvider {
|
|||
}
|
||||
|
||||
if (exportWriter != null) {
|
||||
if (ranChangeSets.isEmpty()) {
|
||||
outputChangeLogTableCreationScript(liquibase, exportWriter);
|
||||
}
|
||||
liquibase.update((Contexts) null, new LabelExpression(), exportWriter, false);
|
||||
} else {
|
||||
liquibase.update((Contexts) null);
|
||||
|
|
Loading…
Reference in a new issue