Liquibase Developer Workflow
Let's go through the entire developer workflow from beginning to end!
On your local development machine, add new changesets to your changelog. The changes are your choice to make.
liquibase update to apply the changes to the developer database. Iterate until you are happy with the final state.
liquibase --url=jdbc:h2:tcp://localhost:9090/mem:integration status --verbose
Running the command in step 3 allows you to see that the integration database has changesets that were not applied.
It is always best practice to know what changes are going to take place BEFORE saving and applying the changelog… especially if someone else edited or created the changelog.
liquibase --url=jdbc:h2:tcp://localhost:9090/mem:integration updateSQL
Running the command in step 4 allows you to see exactly what SQL would run when running the
update command. You can also run a
diff command to compare the changes before saving and applying them.
To run the
diff command, run:
liquibase --url=jdbc:oracle:thin://localhost:9090/mem:test --referenceUrl=jdbc:h2:tcp://localhost:9090/mem:integration referenceUsername dbuser --referencePassword letmein diff.
Save your changelog to source control, when you are happy with the changes that will be applied.
liquibase --url=jdbc:h2:tcp://localhost:9090/mem:integration update to apply the new changesets.
You can re-run the
diff commands as way to see that all the changes have now been applied to integration.
That's the whole workflow! Now, start back at step 1 to continue iterating through the entire cycle until you have a good feel for how Liquibase works.
Now that you have a feel for Liquibase against your sample database, you can try it against your standard databases.
Just add your database's jdbc drivers to the
lib directory in the Liquibase install directory and update the
password fields in the
Also, check the documentation associated with your specific database to locate the correct url format and download the driver jar. Then use the Liquibase Developer Workflow to make changes against your own database.