Say I have 10 scripts but 8 of them are already upto date in the datebase and we just started using Liquibase. For the first deployment I want only those remaining 2 scripts to execute, but it should start tracking all 10 in the changelog table and should be able to autodeploy those 8 scripts from the second release if they are altered.
These are the two options I would recommend (in order of preference):
-
With just the first 8 changesets in your changelogs, run the “changelog-sync” command . This will record those first 8 changesets in the databasechangelog table as EXECUTED, making it look like Liquibase executed them. Then add the 2 new changesets and run “update” to apply those 2 changesets.
-
With all 10 changesets in your changelogs, run the " mark-next-changeset-ran" command 8 times. This will record those first 8 changesets in the databasechangelog table as EXECUTED, making it look like Liquibase executed them. Then run “update” to apply the final 2 changesets.
1 Like
Thank you @daryldoak , that is really helpful.
1 Like