Using Liquibase Contexts and Labels to Control Deployment Scope
Scope Liquibase changeSets by environment and change type using contexts and labels. Includes XML example, runtime flags, and checksum cautions.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Scope Liquibase changeSets by environment and change type using contexts and labels. Includes XML example, runtime flags, and checksum cautions.
Use a single master changelog with context attributes to run environment‑specific migrations in Liquibase. This guide covers the minimal design, trust boundaries, CI checks, failure modes, and when to split changelogs.
SQL Developer 21.4+ bundles Liquibase for schema versioning. Learn to baseline a schema, diff dev against prod, and work around version lag, Oracle-specific clauses, and large-schema timeouts.
Liquibase rollbackCount lets you safely revert a defined number of changesets with deterministic SQL, provided you verify the generated statements and check database status before and after.
When shared dev or staging databases drift, Liquibase changesets can fail with duplicate‑object errors. This post shows how to wrap changesets in preconditions, demonstrates a working example, explains the MARK_RAN trade‑off, and gives practical checks to keep migrations reliable.
Learn how to use Liquibase Contexts to separate environment-specific data from core schema changes, preventing test data from leaking into production databases.
Learn how to add Liquibase preConditions to a changeset to validate table, column, row count, or custom SQL state before applying migrations, with flow control via onFail/onError and verification steps.
Manage database migrations across multiple environments from a single changelog using Liquibase contexts and labels. Learn how to apply changesets conditionally based on environment and feature flags.
Learn how Liquibase contexts let you tag changesets and run only those matching a supplied --contexts argument, with a concrete XML example, verification steps, and common pitfalls.