Author changesets with explicit rollback blocks: in XML use <rollback>DROP TABLE new_table;</rollback>; for AUTO-detected rollbacks (CREATE TABLE, ADD COLUMN) Liquibase infers the rollback automatically
Add preconditions to guard changesets against unsafe double-application: <preConditions onFail='MARK_RAN'><not><tableExists tableName='new_table'/></not></preConditions>
Tag the database state before a deployment: liquibase tag v2.5.0; this creates a bookmark in the DATABASECHANGELOG table that rollback commands reference
Rollback to a tag after a failed deployment: liquibase rollback v2.5.0; Liquibase applies rollback blocks in reverse order back to the tagged state
Use liquibase rollback-one-changeset --changeset-id=<id> --changeset-author=<author> for surgical single-changeset rollback without affecting others
Store credentials in a liquibase.properties file outside source control (reference via --defaults-file) or in environment variables LIQUIBASE_COMMAND_URL, LIQUIBASE_COMMAND_USERNAME, LIQUIBASE_COMMAND_PASSWORD
Known gotchas
Rollback is not possible for destructive operations like DROP TABLE or DROP COLUMN unless you explicitly write a rollback block that recreates the object; test rollback scripts in a staging environment before relying on them in production
The DATABASECHANGELOCK table is acquired for the entire duration of an update or rollback; if a process crashes mid-migration, the lock row may remain and block future runs — check and manually delete the lock row with DELETE FROM DATABASECHANGELOCK if necessary
Precondition failures with onFail='HALT' will stop the entire migration pipeline; use onFail='MARK_RAN' for idempotent changesets (e.g., index creation) and onFail='WARN' for advisory checks so a single precondition miss does not abort a full deployment
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp