Database / Liquibase interview questions
What is the Liquibase status command and how does it differ from validate?
The status command queries DATABASECHANGELOG and compares it against the changeLog file to report which changeSets are pending — not yet applied to the database. It shows each pending changeSet's ID, author, filename, and whether a rollback is defined.
liquibase status --verboseExample output:
3 changesets have not been applied to JDBC:postgresql://localhost:5432/myapp
db/changelog/releases/v2.0/05-add-audit-columns.xml::add-audit-columns::carol
db/changelog/releases/v2.0/06-add-index.xml::add-email-index::carol
db/changelog/releases/v2.0/07-seed-permissions.xml::seed-permissions::release-botThe validate command, by contrast, checks the changeLog file itself for structural correctness — XML validity, schema compliance, duplicate changeSet IDs, missing referenced files, and checksum mismatches against the database. It does not tell you what is pending; it tells you whether the changeLog is safe to run.
In a CI/CD pipeline, a good practice is to run both in sequence:
liquibase validate— Fail fast if the changeLog has errors, before attempting any database access.liquibase status— Confirm what will be applied and fail if no changes are pending when a deployment is expected to carry changes.liquibase update— Apply the changes.
Some teams parse the status output to gate deployments — if status shows 0 pending changes but the pipeline expects schema changes, something is wrong (perhaps the changeLog file was not updated before the deploy).
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
