I have an existing database and have used the generateChangeLog command line to create the initial changelog. This works fine :-)
But now I want the developers to use all the tools/processes they know/use already to develop the database and code and use a script to generate any incremental change sets as appropriate.
That is: do a diff against the current state of the developer's database (url/username/password in the properties file) using the current changelog (changeLogFile in the properties file) as the base reference.
There seems no easy way to do this - the best I've come up with is:
- Create a new temporary database.
- Use liquibase to initialise the temp database (to what is currently in the changelog) by overriding the connection url:
liquibase --url=jdbc:mysql://localhost:3306/tempbase update
- Use liquibase to generate a changeset in the changelog by diff'ing the two databases:
liquibase --referenceUrl=jdbc:mysql://localhost:3306/tempbase --referenceUsername=foo --referencePassword=baz diffChangeLog
- Drop the temporary database.
- Synchronise the changeset:
liquibase changelogSync
but there must be a better way...