Hi, all -
I’m updating to Liquibase 4, and dropping use of the Liquibase class as recommended, and instead using the CommandStep mechanisms described here.
When I run my updates locally, all seems to work, but some of our tests in CI run with our application in a VM and the Postgres DB running in a Docker container hosted by the VM. In this CI environment, Liquibase update summaries appear to say that the updates have been applied, but once our migration is done, nothing has been changed.
Am I missing / misconfiguring an option?
Here’s my code (Kotlin):
class LiquibaseExecutor {
@Throws(LiquibaseException::class)
fun update(database: Database, accessor: ResourceAccessor, contexts: String, changeSetFile: String) {
val scope = mapOf(
Scope.Attr.database.name to database,
Scope.Attr.resourceAccessor.name to accessor
)
try {
Scope.child(scope) {
CommandScope(*UpdateCommandStep.COMMAND_NAME)
.addArgumentValue(DbUrlConnectionCommandStep.DATABASE_ARG, database)
.addArgumentValue(UpdateCommandStep.CHANGELOG_FILE_ARG, changeSetFile)
.addArgumentValue(UpdateCommandStep.CONTEXTS_ARG, contexts)
.addArgumentValue(UpdateCommandStep.LABEL_FILTER_ARG, LabelExpression().originalString)
.addArgumentValue(ChangeExecListenerCommandStep.CHANGE_EXEC_LISTENER_ARG, null)
.addArgumentValue(
DatabaseChangelogCommandStep.CHANGELOG_PARAMETERS,
ChangeLogParameters(database)
)
// TODO - put this line back in -- temp testing...
// .addArgumentValue(ShowSummaryArgument.SHOW_SUMMARY, UpdateSummaryEnum.OFF)
.execute()
}
} catch (e: Exception) {
if (e is LiquibaseException) {
throw e
} else {
throw LiquibaseException(e)
}
}
}
:
}