The runOrder attribute specifies whether a changeset should be run before or after all other changesets instead of running it sequentially based on its order in the changelog. Valid values are first and last. runOrder is not supported in formatted SQL changelogs.


By default, when you run the update command, Liquibase runs changesets sequentially according to their order in the changelog. Changes at the top of the file are run first, and changes at the bottom are run later.

However, you may have a changeset that you always want to run at the end of a deployment. Instead of moving it to the bottom of the changelog for every database update, set runOrder to last on that changeset. This way, it executes after all other changesets regardless of its order in the changelog.


Note: All changelog attributes use the camelCase format.

Related links