Atlas, Flyway, and Liquibase all version your database schema and apply changes from CI, but they make different bets. Flyway runs plain SQL files in order and stays out of your way. Liquibase wraps changes in changesets with rollback metadata and supports XML, YAML, JSON, or SQL formats. Atlas lets you declare the schema you want and generates the migration for you. Licensing also changed in 2025: Liquibase moved its Community edition to a source-available license, and Redgate simplified Flyway's editions. This comparison covers how each tool works in practice, with runnable examples, so you can pick one.
The two models: versioned vs declarative
Before comparing tools, separate the two approaches they implement.
Versioned (imperative) migrations. You write a sequence of change scripts, such as V3__add_orders.sql. The tool records which scripts ran in a history table and applies the rest in order. The migration files are the source of truth. Flyway works this way, and so does Liquibase, with changesets in place of files.
Declarative (state-based) migrations. You describe the target schema, for example a schema.sql with CREATE TABLE statements or an HCL file. The tool inspects the live database, computes the difference, and plans the ALTER statements. The desired state is the source of truth. Atlas is built around this model, and it can also produce versioned files from the diff. That hybrid is what most teams use it for.
Neither model wins outright. Versioned migrations give you an exact, reviewable record of what will run, which matters for data backfills and careful lock management. Declarative workflows remove the tedious part, writing ALTER TABLE by hand and keeping it in sync with the ORM, but you have to trust and review the planner's output.
Quick comparison
| Atlas | Flyway | Liquibase | |
|---|---|---|---|
| Primary model | Declarative, plus generated versioned files | Versioned SQL (and Java) migrations | Versioned changesets |
| Change format | SQL, HCL, or ORM-derived schema | Plain SQL files (V1__name.sql) |
SQL, XML, YAML, or JSON changelogs |
| History table | atlas_schema_revisions |
flyway_schema_history |
DATABASECHANGELOG + lock table |
| Integrity check | atlas.sum file over the migration directory |
Checksums on applied migrations | Checksums on changesets |
| Rollback | migrate down (not in Community build) |
undo scripts (Enterprise) |
--rollback blocks; rollback by tag, count, or date |
| Runtime | Single Go binary | JVM (CLI bundles a JRE), Docker, Maven/Gradle | JVM (Java 17+ for 5.x), Docker, Maven/Gradle |
| Open-source license | Apache 2.0 Community build | Apache 2.0 (engine on GitHub) | FSL-1.1-ALv2 from 5.0 (source-available) |
| Commercial tier | Pro (per seat + usage), Enterprise | Enterprise (quote) | Liquibase Secure |
Latest versions at the time of writing: Atlas v1.3.0, Flyway 13.12.2, and Liquibase Community 5.0.4.
Licensing and editions in 2026
Licensing is now as important as features in this decision. All three vendors changed their terms in the last two years.
Liquibase: Community moved to FSL
Starting with 5.0 (September 2025), Liquibase Community is licensed under the Functional Source License (FSL-1.1-ALv2). Liquibase says plainly that FSL isn't an OSI-approved open-source license. In practice, according to the FAQ, "you can continue to run Liquibase Community in your CI/CD pipelines and production environments." The restriction targets third parties that commercialize Liquibase in competition with the company, for example as a managed service. Each release reverts to Apache 2.0 two years after it ships, and releases before 5.0 stay Apache 2.0.
Version 5.0 also changed packaging. The release notes say Community "ships without extensions, drivers, and many other packages," and the minimum Java version is now 17. You add drivers with the Liquibase Package Manager (lpm). The commercial product is now called Liquibase Secure and adds policy checks, drift detection, and audit features. See Liquibase's Community vs Secure comparison for the current matrix.
Flyway: Community and Enterprise
Redgate's editions page now lists two editions. Flyway Community is "a free database migrations tool for individual developers and education." Flyway Enterprise adds generated undo scripts, drift detection and reporting, policy-as-code checks, and Redgate's comparison engine for schema-as-code workflows. Enterprise pricing is by quote, and there's a 28-day trial. The engine on GitHub is still Apache 2.0.
Atlas: free Starter, paid Pro
Atlas ships in two builds. The Community Edition is built straight from the Apache 2.0 GitHub repo and covers MySQL, MariaDB, PostgreSQL, and SQLite with core versioned and declarative commands. It leaves out migrate down, migrate lint, views, triggers, functions, the Kubernetes operator, the Terraform provider, and drivers such as SQL Server, Oracle, and ClickHouse. The standard binary is free to use under Ariga's terms, and logging in unlocks Pro features. On the pricing page, Pro starts at $9 per developer per month plus usage-based charges for CI/CD projects ($59 per month per project, including two target databases) and extra targets. Linting, drift detection, and schema monitoring are on the paid side.
What this means: if you need a truly open-source license with no field-of-use clause, Flyway's engine and Atlas's Community build qualify. Liquibase 5.x does not, though internal use is explicitly allowed.
Flyway in practice
Flyway's model is the simplest: numbered SQL files in a folder.
migrations/
V1__create_users.sql
V2__create_orders.sql
R__refresh_reporting_views.sql
V files run once, in version order. R (repeatable) files re-run whenever their checksum changes, which suits views and stored procedures. Modern Flyway uses a flyway.toml file with named environments, and the TOML configuration docs show the layout:
[environments.dev]
url = "jdbc:postgresql://localhost:5432/app"
user = "app"
password = "${env.DB_PASSWORD}"
[flyway]
environment = "dev"
locations = ["filesystem:migrations"]
The same migrations run through Docker without a local JVM. On Linux, --network host lets the container reach a database on localhost:
docker run --rm --network host \
-v "$PWD/migrations:/flyway/sql" \
redgate/flyway \
-url=jdbc:postgresql://localhost:5432/app \
-user=app -password="$DB_PASSWORD" \
-locations=filesystem:/flyway/sql \
migrate
flyway info shows applied and pending versions, flyway validate fails if an applied file was edited after it ran, and flyway repair fixes the history table after a failed run on databases without transactional DDL. Undo migrations (U2__create_orders.sql) are an Enterprise feature, and even there you write the undo SQL yourself.
Strengths: almost no learning curve, migrations are just SQL your DBA can read, and the long list of supported databases. Weaknesses: you write every ALTER by hand, and drift detection and rollback require Enterprise.
Liquibase in practice
Liquibase organizes changes as changesets, each identified by author:id and tracked in DATABASECHANGELOG. The formatted SQL changelog is the easiest way in if you think in SQL:
--liquibase formatted sql
--changeset alice:1
CREATE TABLE users (
id BIGSERIAL PRIMARY KEY,
email TEXT NOT NULL UNIQUE,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
--rollback DROP TABLE users;
--changeset alice:2
ALTER TABLE users ADD COLUMN display_name TEXT;
--rollback ALTER TABLE users DROP COLUMN display_name;
Liquibase doesn't generate rollbacks for formatted SQL, so write a --rollback line for every changeset you might need to undo. XML and YAML changelogs that use built-in change types such as createTable or addColumn can derive some rollbacks automatically, which is one reason teams choose those formats.
Since 5.0 you install the JDBC driver yourself:
lpm add postgresql --global
liquibase update \
--changelog-file=changelog.sql \
--url=jdbc:postgresql://localhost:5432/app \
--username=app --password="$DB_PASSWORD"
# Mark a release point, then roll back to it if needed
liquibase tag --tag=v1.4.0 \
--url=jdbc:postgresql://localhost:5432/app --username=app --password="$DB_PASSWORD"
liquibase rollback --tag=v1.4.0 --changelog-file=changelog.sql \
--url=jdbc:postgresql://localhost:5432/app --username=app --password="$DB_PASSWORD"
Put connection settings in liquibase.properties to shorten these commands. liquibase update-sql prints the SQL without running it, which works well as a pull request artifact. Community rolls back by tag, count, or date. Liquibase markets targeted single-changeset rollback, drift reports, and policy checks as Secure features.
Strengths: the most mature rollback model, contexts and labels for environment-specific changes, and broad database support through extensions. Weaknesses: more ceremony per change, the JVM footprint, drivers you now install separately, and a license that legal teams will want to review.
Atlas in practice
Atlas starts from a desired-state file. Take a plain schema.sql:
CREATE TABLE users (
id BIGSERIAL PRIMARY KEY,
email TEXT NOT NULL UNIQUE,
display_name TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE TABLE orders (
id BIGSERIAL PRIMARY KEY,
user_id BIGINT NOT NULL REFERENCES users(id),
total_cents BIGINT NOT NULL CHECK (total_cents >= 0)
);
For quick declarative workflows, such as local development or ephemeral environments, apply it directly. Atlas inspects the target, computes the diff, and asks for approval:
atlas schema apply \
--url "postgres://app:secret@localhost:5432/app?sslmode=disable" \
--to file://schema.sql \
--dev-url "docker://postgres/17/dev?search_path=public"
The --dev-url points at a throwaway database that Atlas starts in Docker. It uses that database to normalize and validate SQL, so plans come from the database's own interpretation of your DDL rather than a parser's guess. These command forms come from the Atlas getting-started guide.
For production, most teams use Atlas's versioned workflow: Atlas writes the migration file and you review it. Put the settings in atlas.hcl:
env "local" {
src = "file://schema.sql"
url = getenv("DATABASE_URL")
dev = "docker://postgres/17/dev?search_path=public"
migration {
dir = "file://migrations"
}
}
# Generate a new migration file from the schema change
atlas migrate diff add_orders --env local
# Apply pending migrations (use --dry-run to preview)
atlas migrate apply --env local
migrate diff writes a timestamped SQL file and updates atlas.sum, a checksum file for the migration directory. If two branches add migrations at the same time, the sum file conflicts in Git, so concurrent changes are caught at merge time instead of in production. Atlas can also load the desired schema from ORMs such as GORM, Ent, Django, SQLAlchemy, Hibernate, Sequelize, TypeORM, Prisma, Drizzle, and Doctrine. That's a big advantage if you've struggled to keep ORM models and SQL migrations in sync. Our Drizzle vs Prisma comparison covers the ORM side of that problem.
Strengths: no hand-written ALTERs, a dev-database-backed planner, atlas.sum merge protection, and a single static binary. Weaknesses: the Community build has gaps (views, functions, triggers, extra drivers, migrate down, and linting all need the standard binary, mostly on paid tiers), and you still have to review what the planner produces.
Rollback: what each tool really gives you
Rollback in schema migration is mostly a myth for destructive changes. No tool can bring back a dropped column's data. What these tools offer:
- Flyway Community: none. You write a new forward migration. Enterprise adds
undo, which runs aUscript you wrote yourself. - Liquibase Community:
rollbackby tag, count, or date, using the rollback SQL attached to each changeset. This is the most built-out rollback model of the three when you write the rollback blocks. - Atlas:
migrate downcomputes the reverse plan for applied migration files and checks it against the dev database. It isn't in the Apache-licensed Community build.
Whatever you choose, use expand/contract: add new columns and tables first, deploy code that writes to both, backfill, switch reads, then drop the old structure in a later release. With expand/contract, a "rollback" is just redeploying the previous app version.
Drift detection
Drift happens when someone changes production by hand. A hotfix index or a manually widened column is enough.
- Flyway
validateonly catches edited migration files. It doesn't catch manual changes to the database. Real drift detection (check -drift, which writes HTML and JSON reports and can fail a pipeline) is Enterprise. - Liquibase Community has
diffanddiff-changelog, which compare two databases. Scheduled drift reports are part of Secure. - Atlas can compare a live database to your desired state with
atlas schema diff. Continuous schema monitoring is a paid add-on.
A cheap do-it-yourself approach that works with any tool: in CI, run all migrations against an empty database, dump the schema, dump production's schema with the same tool, and diff the two.
Running migrations in CI
The pattern is the same for all three tools: spin up a disposable database, apply every migration from scratch, then run tests. Here's a GitHub Actions job using Flyway's Docker image:
name: migrations
on: [pull_request]
jobs:
migrate:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: app
POSTGRES_PASSWORD: app
POSTGRES_DB: app
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U app"
--health-interval 5s --health-timeout 5s --health-retries 10
steps:
- uses: actions/checkout@v4
- name: Apply all migrations to an empty database
run: |
docker run --rm --network host \
-v "$PWD/migrations:/flyway/sql" redgate/flyway \
-url=jdbc:postgresql://localhost:5432/app -user=app -password=app \
-locations=filesystem:/flyway/sql migrate
- name: Show migration state
run: |
docker run --rm --network host \
-v "$PWD/migrations:/flyway/sql" redgate/flyway \
-url=jdbc:postgresql://localhost:5432/app -user=app -password=app \
-locations=filesystem:/flyway/sql info
For Atlas, replace the Docker steps with curl -sSf https://atlasgo.sh | sh and atlas migrate apply --dir file://migrations --url "postgres://app:app@localhost:5432/app?sslmode=disable". For Liquibase, use the liquibase/liquibase image with lpm add postgresql --global run first. Ariga also publishes official GitHub Actions for Atlas. Its pull-request migration linting is a paid feature. For broader pipeline design, see our comparison of Dagger and GitHub Actions.
Which one should you choose?
| Your situation | Pick |
|---|---|
| Small team, PostgreSQL or MySQL, SQL-first, wants zero ceremony | Flyway Community |
| Regulated environment, needs rollback scripts and an audit trail per change | Liquibase (Community, or Secure for policy and drift) |
Schema lives in an ORM or you're tired of hand-writing ALTERs |
Atlas |
| Many database engines including Oracle or SQL Server, with a DBA team | Flyway Enterprise or Liquibase Secure |
| Strict open-source license requirement | Flyway engine or Atlas Community build |
| Kubernetes-native GitOps for schemas | Atlas (Kubernetes operator, standard binary) |
Switching later is easier than it looks. All three can baseline an existing database: Flyway with baseline, Atlas with migrate apply --baseline, and Liquibase with changelog-sync. You can adopt a new tool at a known schema version without replaying history.
Frequently Asked Questions
What is the best database schema change automation tool?
No single tool fits every team. Flyway is the simplest for SQL-first teams. Liquibase has the most complete rollback and governance model. Atlas is the strongest for declarative, ORM-driven workflows. Choose based on your rollback, licensing, and database-engine needs.
Is Liquibase still open source?
Liquibase Community 5.0 and later uses the Functional Source License, which Liquibase itself says doesn't meet the OSI definition of open source. Internal use, including CI/CD and production, is allowed. Each release converts to Apache 2.0 after two years, and versions before 5.0 remain Apache 2.0.
Is Flyway free?
Flyway Community is free, and the engine is Apache 2.0 on GitHub. Undo migrations, drift detection, and policy checks require Flyway Enterprise, which is priced by quote.
Can Atlas work with existing Flyway or Liquibase migrations?
Atlas can baseline an existing database and continue with its own migration directory. Its migrate import command converts migration directories from other tools, including flyway and liquibase formats, for example atlas migrate import --from "file://migrations?format=flyway" --to "file://atlas-migrations". Review the imported files before relying on them.
Do I need rollback scripts at all?
For most production systems, forward-only migrations with expand/contract are safer than rollbacks, because a rollback can't restore dropped data. Rollback scripts are still useful for failed deployments of purely additive changes and in regulated environments that require a documented back-out plan.
Which tool works best with PostgreSQL?
All three support PostgreSQL well. Atlas has the edge for declarative workflows on PostgreSQL. Views, functions, triggers, and extensions need its standard binary rather than the Community build. Flyway and Liquibase handle anything you can write in SQL.
Conclusion
Flyway, Liquibase, and Atlas solve the same problem with different philosophies. Flyway gives you ordered SQL files and little else, and it's rarely the wrong choice for a small team. Liquibase gives you per-change rollback and governance, but 5.0 brought a source-available license and separately installed drivers. Atlas generates migrations from the schema you want and catches conflicting changes at merge time, with its most useful safety features on paid tiers. Pick the model first (versioned or declarative), then the license your organization can live with, and use expand/contract whichever tool you choose. If you're also choosing where the database runs, our Neon vs Supabase comparison covers the managed PostgreSQL side.