Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to diff without a database #213

Open
AlexCzar opened this issue Oct 17, 2019 · 2 comments
Open

Unable to diff without a database #213

AlexCzar opened this issue Oct 17, 2019 · 2 comments

Comments

@AlexCzar
Copy link

AlexCzar commented Oct 17, 2019

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.

┆Issue is synchronized with this Jira Bug by Unito

@jayfray12
Copy link

+1 It would be nice to have this feature

@AlexCzar
Copy link
Author

AlexCzar commented Aug 11, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants