Flyway vs Liquibase: Migration Tools Compared
Flyway and Liquibase are the two most established database migration tools. Both run on the JVM, both record applied changes in a tracking table inside the target database, and both ship a free edition with paid tiers layered on top. They diverge on three things that usually decide the choice: how a change is authored, what rollback actually does, and how each project is licensed.
This page compares them point by point against their current vendor documentation, then covers a third option for teams that want declarative schema-as-code.
Short answer. Both tools limit rollback in ways worth understanding before you commit.
- Flyway fits a team that writes SQL against one or two engines and wants the smallest possible model.
- Liquibase fits an estate that spans many engines and needs preconditions, contexts, and labels, with rollback in the free edition.
- Atlas fits teams that would rather declare the schema than author each change; see A Third Option.
This page is maintained by the Atlas team and was verified in September 2026 against the vendors' own documentation. Both tools release frequently, so check the official Redgate and Liquibase docs for current details.
Capabilities marked (Atlas Pro) are part of the Atlas Pro plan. Running
atlas login starts a free 30-day trial.
Quick Comparison
| Feature / Capability | Flyway (Redgate) | Liquibase |
|---|---|---|
| Change format | Versioned SQL files with a numeric prefix (V1__init.sql) | Changelogs of ordered changesets in XML, YAML, JSON, or formatted SQL |
| Change ordering | File version number | Order of changesets in the changelog, plus preconditions, contexts, and labels |
| Free edition | Community | Community |
| License | Flyway engine under Apache 2.0; open-source package excludes the CLI | Community 5.0 and later under FSL-1.1-ALv2; 4.x releases remain Apache 2.0 |
| Paid editions | Teams, Enterprise | Liquibase Secure |
| Runtime | Java; the CLI download bundles a Temurin 21 JRE, and a supplied JRE must be Java 21 | Java 17 or newer for 5.0 and later |
| Change tracking table | flyway_schema_history | DATABASECHANGELOG and DATABASECHANGELOGLOCK |
| Script generation | diff, model, and generate against a schema model | diff-changelog between two databases |
| Adopting an existing database | flyway baseline | liquibase generate-changelog, then changelog-sync |
| State-based deployment | Schema model with prepare and deploy, Enterprise only | Not available |
| Preview SQL before applying | Dry run output, Teams and above | update-sql, every edition |
| Rollback | Undo migrations (U__ prefix), Teams and above; Enterprise generates the undo scripts | rollback commands in every edition; auto-generated only for supported change types |
| Static analysis | Policy-as-code checks in Enterprise | Policy checks in Secure |
| Drift detection | Continuous monitoring in Enterprise | diff and diff-changelog run on demand; reporting in Secure |
| Database support | 50+ engines (includes cloud-managed variants counted separately) | 60+ relational, NoSQL, and graph databases (also counts cloud-managed variants separately) |
| GUI | Flyway Desktop for Windows and macOS, available to all editions | VS Code extension in Secure |
| Commercial model | Per user, contact sales | Per application and database type, contact sales |
Licensing and Editions
Licensing is the sharpest difference between the two projects right now, and it changed on the Liquibase side in 2025.
Flyway
The Flyway engine is published on GitHub under the Apache License 2.0. Redgate splits the codebase so that the open-source package contains no proprietary functionality, and as part of that split the open-source package no longer includes the CLI. Proprietary capabilities such as undo ship as plugins on top of a core that is identical between the open-source and commercial builds.
Redgate distributes three editions:
- Community is free. It provides the CLI and migration execution, with no undo support and no object-level versioning.
- Teams adds object-level versioning, dry-run output of the aggregated migration set, and undo migrations. Teams licenses are capped at 100 schemas.
- Enterprise adds script generation through Redgate's comparison engine, generated undo scripts, policy-as-code enforcement before merge, and continuous drift monitoring.
Teams and Enterprise are supersets of Community and have been sold per user since September 2022.
Liquibase
Liquibase Community was licensed under Apache 2.0 through the 4.x line. Starting with version 5.0 it
is licensed under the Functional Source License, Version 1.1, ALv2 Future License
(FSL-1.1-ALv2). The FSL is a source-available license, not an OSI-approved open-source license: it
permits free use including production, prohibits commercial use that competes with Liquibase's own
products, and reverts to Apache 2.0 two years after each release. Releases already published under
Apache 2.0 stay under Apache 2.0.
Version 5.0 also split the distributions. The Community build is what ships through the usual
GitHub, Docker, and Maven channels. It no longer bundles extensions, drivers, and several other
dependencies; those are installed through the Liquibase Package Manager with liquibase lpm. The
commercial product, previously Liquibase Pro, is now Liquibase Secure and is distributed separately.
If you are evaluating Liquibase under a policy that requires OSI-approved open-source dependencies, this is the detail to check first. Pinning to a 4.x release keeps you on Apache 2.0, and any 5.x release converts to Apache 2.0 two years after it ships.
Neither vendor publishes list prices: Flyway sells Teams and Enterprise per user, Liquibase Secure is sold per application and database type, and both are quoted through sales.
Versioned SQL Files vs Changelog Changesets
Both tools are migration runners: you author the change, and the tool decides what has already been applied and runs the rest in order. The authoring format is where they part ways.
Flyway migrations are plain SQL files whose name carries the version, a separator, and a description,
for example V2__add_users_email.sql. Flyway applies them in version order and stores a checksum of
each in flyway_schema_history, so editing an applied migration causes validation to fail.
Repeatable migrations use an R__ prefix and re-run whenever their checksum changes.
Liquibase migrations are changesets inside a changelog. Each changeset carries an id and an
author, and can be written in XML, YAML, JSON, or formatted SQL. Modeled changesets use
database-agnostic change types such as createTable or addColumn, and Liquibase renders the
engine-specific SQL at runtime. Changesets also support preconditions, contexts, and labels, which
gate whether a change runs against a given target. Liquibase records each applied changeset and its
checksum in DATABASECHANGELOG and halts on a mismatch.
The trade-off is portability against directness. Modeled changelogs describe one change once and target many engines, at the cost of an abstraction layer between what you write and what runs. Flyway's SQL files are exactly what executes, which makes them easy to review and easy to reason about, but they are written per engine.
Neither tool derives the schema from a desired state. In both, the current schema is the accumulated result of replaying every change in order.
Rollback
Both tools can revert changes, and both put meaningful limits on it.
Flyway
Flyway calls this undo migrations, written as files with a U__ prefix that pair with a versioned
migration. Undo is a Teams edition feature; Community does not support it. Flyway Enterprise can
generate undo scripts through the comparison engine rather than having you write them.
Redgate's own documentation is direct about the limits. Undo migrations work for schema changes but not well for data changes, they cannot recover from a migration that failed partway because an undo script reverses a whole migration rather than a partial one, and they warn to take care when the deployment contains drops, deletes, or truncates. The documentation recommends keeping the database backwards compatible with all deployed application versions, backed by a tested backup and restore strategy, rather than relying on undo alone.
Liquibase
Liquibase provides rollback to a tag, rollback-to-date, rollback-count, and targeted commands
such as rollback-one-changeset and rollback-one-update. Changesets roll back bottom to top.
Rollback SQL is auto-generated only for supported modeled change types, including createTable,
addColumn, and renameColumn. Change types with no single inverse do not auto-generate:
dropTable and insert both require a custom rollback, and no formatted SQL changeset supports
auto rollback regardless of what it contains. For those you write the reverse yourself in a
<rollback> tag, a --rollback comment, or a referenced rollbackSqlFile. Liquibase's guidance is
to author rollback logic for every changeset, and the RollbackRequired policy check in Liquibase
Secure can enforce that.
One ordering caveat applies to both tools: roll back before editing a changeset or migration, since editing first produces a checksum mismatch that blocks the rollback.
Script Generation and State
Neither tool starts from a desired schema by default, but both can compare two things and emit changes from the difference.
Flyway's schema model is a version-controlled representation of how each object should look.
flyway diff compares sources, flyway model writes the result into the schema model, and
flyway generate produces migration scripts for review, emitting versioned and undo scripts by
default. There is also a fully state-based path where flyway prepare builds a deployment script by
comparing the schema model to a target and flyway deploy applies it, with no hand-authored
migrations in between. Automating state-based deployment requires an Enterprise license, and the
comparison engine covers SQL Server, Oracle, PostgreSQL, and MySQL. Redgate notes that some changes
cannot be inferred by comparison, such as adding a NOT NULL column without a default to a table
that already holds data.
Liquibase offers diff and diff-changelog, which compare two databases and write the differences
out as a changelog you can review and deploy. It is an on-demand command, typically used to bootstrap
a project from an existing database or to inspect drift between environments. Liquibase has no
state-based deployment mode: the changelog remains the source of truth and is applied in order.
CI/CD and Automation
Both tools are CLI-first and both run cleanly in a container, so the integration story is more alike than different.
Flyway ships the CLI, Maven and Gradle plugins, a Java API, and official Docker images. Redgate published official GitHub Actions for Flyway in March 2026, and the Enterprise edition advertises native CI/CD integration with GitHub, Azure DevOps, and Jenkins. Flyway Desktop is a GUI for Windows and macOS, available across all three editions, and its installer also places the CLI on the PATH.
Liquibase ships the CLI, Maven, Gradle, and Ant plugins, a Java API for running migrations in-process, Spring Boot integration, and official Docker images. It provides an official GitHub Action and a Jenkins plugin, and is commonly driven from GitLab pipelines. Liquibase Secure adds a VS Code extension.
Neither project publishes an official Kubernetes operator or Terraform provider. In Kubernetes both are usually run from a Job or an init container that executes the CLI before the application starts.
Database Support
Flyway lists 50+ database management systems and grades them in two tiers. Supported means the engine is certified and covered by Redgate product support for Teams and Enterprise customers. Compatible means limited testing with community forum support. Certification also has a clock on it: a database release is generally certified for five years from its GA date under Community, extended to ten years under Teams. The advanced Enterprise features, including object-level versioning and comparison-based generation, cover a narrower set than the full list.
Liquibase lists 60+ database platforms spanning relational, NoSQL, and graph engines, and splits them between databases it maintains and community-maintained databases. More than half of the supported engines were contributed by the community and vendors
Both lists also count cloud-managed variants of the same engine as separate entries: Amazon RDS for PostgreSQL, Aurora PostgreSQL, and Google Cloud SQL for PostgreSQL each appear on their own alongside PostgreSQL itself, and the same pattern repeats for MySQL, MariaDB, SQL Server, and Oracle. The number of genuinely distinct engines, as opposed to managed-hosting variants of the same engine, is smaller than either headline figure.
Choosing Between Flyway and Liquibase
Flyway tends to fit when:
- Your team writes SQL and wants no abstraction between the file and what executes.
- You target one or two engines, so cross-database portability buys you nothing.
- You want the smallest possible model: numbered files, one command, done.
- You are already in the Redgate ecosystem, or you want the Enterprise comparison engine to generate both migration and undo scripts.
Liquibase tends to fit when:
- You target many heterogeneous engines and want one changelog definition to cover them.
- You need fine-grained control over whether a change runs: preconditions, contexts, and labels.
- You want rollback available in the free edition rather than behind a paid tier.
- You are standardizing change management across many teams and database types at once.
Two constraints cut across both. Rollback is limited in both tools and needs a real strategy behind it either way. And the license question now differs: Flyway's engine is Apache 2.0 with a proprietary CLI, while Liquibase Community 5.0 and later is source-available under the FSL.
A Third Option: Declarative Schema-as-Code
Flyway and Liquibase both ask: “What change do I apply next?” Atlas asks: “What should the schema look like?” and figures out the changes for you.
You declare the desired schema in SQL or HCL, or load it from an ORM model or an existing database. Atlas inspects the current state, diffs it against the desired state, and plans the statements that close the gap.
- Versioned
- Declarative
atlas migrate diff add_users_email \
--dir "file://migrations" \
--to "file://schema.sql" \
--dev-url "docker://postgres/15/dev?search_path=public"
atlas schema apply \
--url "postgres://localhost:5432/app?search_path=public&sslmode=disable" \
--to "file://schema.sql" \
--dev-url "docker://postgres/15/dev?search_path=public"
The practical differences against both tools:
- Migration planning is automatic. You edit the schema, not the migration. Atlas generates the migration file in versioned mode, or applies the plan directly in declarative mode.
- Rollback is computed, not authored.
atlas migrate downinspects the live database and generates the statements needed to reach a chosen version or tag, including after a migration that failed partway. There are no undo files to keep in sync (Atlas Pro). - Changes are linted before they run.
atlas migrate lintflags destructive changes, table locks, and data-dependent alterations, and custom rules enforce team conventions in CI (Atlas Pro). - Schemas are testable. Schema and data migrations can be unit tested locally and in CI (Atlas Pro).
- It runs as a single binary. No JVM and no runtime to provision on CI agents.
Atlas supports both workflows, so adopting it does not mean giving up versioned migration files. If you are coming from either tool specifically, the head-to-head pages go deeper:
Frequently Asked Questions
Is Flyway free?
Flyway Community is free, and the Flyway engine is published under Apache 2.0. The paid Teams and Enterprise editions are sold per user and quoted through sales. Several capabilities covered above are not in Community, including undo migrations, script generation, and policy-as-code checks.
Is Liquibase still open source?
Not in the strict sense, as of version 5.0. Liquibase Community 5.0 and later is licensed under the
Functional Source License (FSL-1.1-ALv2), which is source-available rather than OSI-approved: use
stays free including in production, but commercial use competing with Liquibase's own products is
prohibited. Each release reverts to Apache 2.0 two years after it ships, and 4.x releases remain
Apache 2.0.
Does Flyway support rollback?
Only in the paid editions. Undo migrations use a U__ prefix and are a Teams feature, so Community
has no undo support at all; Enterprise can generate the undo scripts rather than having you write
them. Redgate's documentation notes that undo works for schema changes but not well for data
changes, and cannot recover from a migration that failed partway.
Can Liquibase roll back any change?
No. Rollback SQL is auto-generated only for supported modeled change types such as createTable,
addColumn, and renameColumn. Change types with no single inverse, including dropTable and
insert, need a custom rollback, and no formatted SQL changeset supports auto rollback regardless of
what it contains.
Can I start with an existing database?
Yes, in both. Flyway marks an existing database as the starting point with flyway baseline.
Liquibase generates a changelog from the live database with liquibase generate-changelog, then
marks those changesets as already applied with changelog-sync.
Do Flyway and Liquibase need Java?
Both run on the JVM. The Flyway CLI download bundles a Temurin 21 JRE, and supplying your own requires Java 21. Liquibase 5.0 and later requires Java 17 or newer.
Which should I choose?
Flyway suits a team that writes SQL against one or two engines and wants the smallest possible model. Liquibase suits an estate spanning many engines that needs preconditions, contexts, and labels, and it keeps rollback in the free edition. If you would rather declare the schema than author each change, Atlas plans the migration from a declared desired state instead.
Next Steps
Declarative vs Versioned
The two workflows Atlas supports and when each one fits
Migrating from Flyway
Step-by-step guide to move a Flyway project to Atlas
Liquibase Rollback Alternative
Using atlas migrate down in place of Liquibase rollback commands
Flyway Undo Alternative
Using atlas migrate down in place of Flyway undo scripts
Automatic Migration Planning
How Atlas generates migration files from a declared schema
Atlas vs Others
How Atlas compares to the wider set of migration tools