The mark-next-changeset-ran-sql command is a helper command that inspects the SQL Liquibase will run while using the mark-next-changeset-ran command.


The mark-next-changeset-ran-sql command is used to inspect the raw SQL before running the mark-next-changeset-ran command, so you can correct any issues that may arise before running the command. Liquibase uses the raw SQL to mark the next changeset you apply as executed in your database and to keep that changeset in the changelog as a record assuming that it has already been deployed.

Running the mark-next-changeset-ran-sql command

To run the mark-next-changeset-ran-sql command, specify the driver, classpath, and URL in the Liquibase properties file. For more information, see Specifying Properties in a Connection Profile. You can also specify these properties in your command line.

Then run the mark-next-changeset-ran-sql command:

liquibase mark-next-changeset-ran-sql

Note: Enter the name of the changelog that you want to use in place of mark-next-changeset-ran-sql and include your database type in place of oracle if you use the .sql file format.

mark-next-changeset-ran-sql global attributes

Tip: All commands and parameters use the --kebab-case format in the CLI environment. This is the format Liquibase recommends for best results. If your preference is camelCase, it will still work in the CLI.

Attribute Definition Requirement
--changelog-file Specifies the root changelog Required
--url Specifies the JDBC database connection URL Required
--username Specifies the database username Required
--password Specifies the database password Required
--output-file * Specifies the file path to where the mark-next-changeset-ran SQL will be written Optional

*If not specified, the mark-next-changeset-ran SQL output goes to STDOUT.

Note: The username and password attributes are not required for connections and systems which use alternate means of authentication.