mark-next-changeset-ran-sql
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.
Uses
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 --changelog-file=dbchangelog.oracle.sql 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
Attribute |
Definition |
Requirement |
|
Specifies the root changelog |
Required |
|
Specifies the JDBC database connection URL |
Required |
|
Specifies the database username |
Required |
|
Specifies the database password |
Required |
|
Specifies the file path to where the |
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.

Liquibase Community 4.9.1 by Liquibase
-- *********************************************************************
-- SQL to add all changesets to database history table
-- *********************************************************************
-- Change Log: example-changelog.sql
-- Ran at: 5/6/22, 9:44 AM
-- Against: DBUSER@jdbc:h2:tcp://localhost:9090/mem:dev
-- Liquibase version: 4.9.1
-- *********************************************************************
-- Lock Database
UPDATE PUBLIC.DATABASECHANGELOGLOCK SET LOCKED = TRUE, LOCKEDBY = 'DESKTOP-SQVSSV2 (192.168.1.179)', LOCKGRANTED = NOW() WHERE ID = 1 AND LOCKED = FALSE;
-- Release Database Lock
UPDATE PUBLIC.DATABASECHANGELOGLOCK SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;
Liquibase command 'mark-next-changeset-ran-sql' was executed successfully.