0
votes

Consider project with different language modules that use same database. Database is controlled by liquibase. Liquibase changeLog files placed in special github repository. So every developer could download it and run locally to keep local instance of database in actual state.

Often developers use inmemory database like H2 for testing and liquibase rebuilds database structure every test run. To keep testing database in actual state every developer need to download changeLogs and put in their modules manually. But sometimes he could miss that somebody else changed database structure, so his tests should fail, but will pass. This is more actual for testing in CI.

Could liquibase download changelogs automatically from internet source? Could it use private github repositories? Could it use some property like changeLogFile for this?

2
Welcome to Stack Overflow - typically you will want to attempt to write some code after researching it online or doing tutorials. Once you have done this post you code / errors here for support. stackoverflow.com/help/how-to-ask - Nelles

2 Answers

1
votes

May I confirm some assumptions? It sounds you have a team of developers all commiting liquibase database changes and you want to be able to automatically deploy in a CI/CD process?

Thanks,

Ronak Liquibase Developer Evangelist

0
votes

Liquibase can't run changelogs placed into some remote git repo. But in your CI you can setup such thing: if there is a pull-request from branch 'feature' to branch 'master' automatically:

  1. Before tests are executed checkout branch 'feature' and merge 'master' there
  2. Apply all changelogs
  3. Run tests after it

So if another developer change DB structure and commit it into master tests in 'feature' branch will be executed with latest DB structure.