liquibase-hibernate
liquibase-hibernate copied to clipboard
Unable to diff without a database
When there is no live database changelog diff cannot be generated (or documentation is missing). In our projects developers work with embedded h2 database while there is a production PostgreSQL database. We need to be able to generate diff between what we have in entities and what is already in the changelog. PostgreSQL is not accessible and application is not launched during changelog generation, so there is no h2. our setup is like this:
configure<LiquibaseExtension> {
activities {
register("main") {
(arguments as MutableMap<String, String>).putAll(mapOf(
"changeLogFile" to "src/main/resources/db/changelog/db.changelog-${project.name}.xml",
"url" to "hibernate:spring:com.example.core.${project.name}?dialect=org.hibernate.dialect.H2Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy"
))
}
}
}
Initial changelog is generated successfully where changeLogFile
points to, but then, after changes in code, I have no idea what I can set into referenceUrl
to get the diff.
+1 It would be nice to have this feature
In the end we went with docker, basically we start the application with ddl-auto on a fresh postgresql docker image, and then diff against it. I still think resolving this issue would be useful though.