Skip to main content

Top Open Source Postgres Migration Tools in 2026

Tianzhou · Nov 5, 2026

Update history

  1. Narrow the list to tools built for Postgres: drop Flyway, Liquibase, Sqitch, DBLift, and Atlas (multi-engine) and the general-purpose runners from the side note; say why, and where to read about them instead; refresh versions and star counts for the tools that stay; tighten the prose throughout.
  2. Deepen: add the four Postgres-specific questions (transactional DDL and CONCURRENTLY, lock timeouts, rollback, out-of-order runs) with a per-tool answer table; show what a migration looks like in each tool; add the language-native runners (golang-migrate, goose, dbmate, node-pg-migrate) and Squawk; add a where-it-stops line per tool; note that Bytebase sponsors pgschema; correct Reshape, which is active again; note Atlas Community's Postgres object coverage, Liquibase's FSL license, and graphile-migrate 2.0 release candidates; refresh versions and star counts.
  3. Add DBLift, the only Python tool on the list; update pgschema, now past 1,000 stars and on the 1.x line; refresh star counts and the Flyway edition and version facts.
  4. Refresh and expand for 2026: add Atlas, Sqitch, and pgschema; group the tools by camp (versioned, declarative, zero-downtime); verify maintenance status, license model, and current version for every tool; add per-tool star counts; move the summary table below the tool sections; remove the stale star-history chart.
  5. Initial version.

This post is maintained by Bytebase, an open-source database governance platform. We update the post periodically.

Postgres keeps climbing the popularity charts (DB-Engines named it DBMS of the Year 2023, and in the November 2026 ranking it is the only one of the top four still gaining, four points shy of SQL Server for third place). And yet doing a schema migration in it is still a PITA. A small industry of tools has grown up to make it less so. This post covers the ones that exist because of Postgres: tools that treat transactional DDL, CONCURRENTLY, row-level security, and the ACCESS EXCLUSIVE lock as the job rather than as one engine's quirks. They fall into three camps: versioned tools that run your scripts in order, declarative tools that diff a desired schema against the live one, and zero-downtime specialists that rewrite big tables without taking a lock. Bytebase is the odd one out: it runs on other engines too, but it's ours, and the governance layer it adds is the part none of the others attempt.

All open source and actively maintained as of November 2026:

What's not on it. Earlier versions listed Flyway, Liquibase, Sqitch, DBLift, and Atlas. All fine, all still active, all multi-engine by design, and on Postgres that shows: each runs whatever SQL you hand it and leaves the Postgres-specific decisions (transaction or not, lock timeout, which objects a diff can see) to you or to a paid tier. If your shop already standardized on one, keep it; the two incumbents get their own treatment in Bytebase vs. Flyway and Bytebase vs. Liquibase. The language-native runners (golang-migrate, goose, dbmate, Alembic, the ORM migrators) are out for the same reason.

Four Postgres questions to ask any of them

Most migration-tool roundups are written as if the database didn't matter. For Postgres it does: Postgres has transactional DDL and MySQL doesn't, and most of the real differences between these tools come down to how they handle that.

1. Does it wrap each migration in a transaction, and can I opt out? Postgres can roll back a half-applied ALTER TABLE, which is a gift. The catch is CREATE INDEX CONCURRENTLY: it refuses to run inside a transaction block. A tool that always wraps fails on exactly the statement you need for a hot table; a tool that never wraps throws away the gift. You want "wrap" as the default, with a per-migration escape hatch.

2. Does it set a lock timeout? Most forms of ALTER TABLE take an ACCESS EXCLUSIVE lock. If a long-running query holds a conflicting lock, your ALTER waits, every query behind it queues up, and without lock_timeout the whole app stalls until the slow query ends.

3. What is the rollback story? Postgres rolls back a migration that fails mid-flight. It does not undo one that succeeded. The tools answer three ways: hand-written down scripts, generated reverse diffs, or (the expand/contract camp) a window during which the old schema is still live and rollback is one command.

4. What happens when two developers' migrations land out of order? On a team, V7 merges before V6. Versioned tools either refuse, apply it anyway, or track dependencies explicitly. Declarative tools don't have the problem: there is no order, only a diff.

ToolTransaction per migrationLock timeoutRollback after successOut-of-order
graphile-migrateYes; --! no-transaction markerYour SQLNone by design (roll-forward only)Linear, single committed history
pgschemaAdaptive: wraps, except CONCURRENTLY and VALIDATE steps--lock-timeout with retryRe-plan from the old schema fileN/A, plus fingerprint check at apply
pgrollPer-operation, with backfill in batches--lock-timeout, default 500 mspgroll rollback until you completeLinear migration history
ReshapePer-actionFixed 1 s, with retryreshape migration abort until you completeLinear, file-name sorted
BytebaseYes by default; per-plan toggle offReview rule flags locking DDLData: backup + rollback; schema: earlier versionIssue order, reviewed

"Your SQL" means the tool runs what you give it, so SET lock_timeout = '5s'; at the top of the file works, if you remember it. The multi-engine tools all answer that column the same way; the Postgres-specific ones mostly set it for you.

The versioned camp

graphile-migrate

graphile-migrate is the opinionated, roll-forward, TypeScript runner for the Graphile and PostGraphile crowd. Its signature is a git-like local loop: you edit migrations/current.sql, graphile-migrate watch re-applies it to your dev database on every save, and when you're happy, commit moves it into committed/ and resets a shadow database. uncommit backs it out while you iterate. Because watch re-runs it on every save, the current migration has to be idempotent:

--! no-transaction
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_orders_email ON orders (email);

The opinions page is worth reading even if you never use the tool, because it's a tidy summary of how Postgres migrations should behave: wrap in a transaction by default, mark the exceptions explicitly, use SET LOCAL not SET, never edit a committed migration, keep roles out of migrations. Rollbacks are rejected on principle: the author's line is that in ten years of API development he has never run one in production.

2.0 has been in release candidates since September 2026 (rc.7 in October). MIT, ~840 stars.

Where it stops: outside PostGraphile land there's little reason to reach for it, and the two-database dev setup (main plus shadow) is a requirement, not an option. Inside it, it fits like a native.

Also in this camp

node-pg-migrate (~1,500 stars, Postgres-only) is the other Node option: migrations as JavaScript or TypeScript calling a builder API (pgm.createIndex(..., { concurrently: true }), paired with a pgm.noTransaction() you have to remember yourself), or plain .sql files. v10 is in alpha as of October 2026. And whichever runner you pick, add Squawk (~1,300 stars, releasing weekly): a Postgres-only linter that fails CI on the footguns in questions one and two, a non-concurrent index, a constraint added without NOT VALID, a volatile default, a migration that never sets lock_timeout.

The declarative camp

pgschema

pgschema (Go) brings the Terraform model to Postgres schema. Dump the live schema to a SQL file, edit it to the state you want, and let the tool plan and apply the diff:

pgschema dump → edit schema.sql → pgschema plan → pgschema apply

Postgres-only is the feature. Instead of the lowest-common-denominator abstraction a multi-engine tool settles for, it diffs the objects generic tools skip, across Postgres 14 through 18: row-level security policies, partitioned tables, constraint triggers, aggregates, domains, default privileges, column-level grants, materialized views with their indexes. All of it in the Apache-2.0 build; there is no gated tier.

apply is where it answers the four questions directly. plan emits Transaction: true or false per plan, and apply is transaction-adaptive: CREATE INDEX CONCURRENTLY runs outside a transaction, and an online constraint add splits ADD ... NOT VALID and VALIDATE CONSTRAINT into separate commits. --lock-timeout 30s retries with exponential backoff instead of failing on the first contended lock. And a plan carries a fingerprint of the schema it was computed against, so if someone changed the database between plan and apply, apply refuses and tells you to re-plan. No shadow database to provision; it embeds one.

Launched mid-2025, past 1,000 stars, on the 1.x line (1.13.4 in October 2026). Full disclosure: Bytebase sponsors it, so weigh this entry accordingly. It's still the Postgres-only option I'd point a desired-state team to.

Where it stops: no Windows build (use WSL), and declarative means a DROP you didn't intend shows up as a line in a plan rather than a file you wrote. Read the plan. If you need the same model across several engines, that's Atlas, whose free build sees only tables, columns, indexes, and constraints on Postgres; views, functions, triggers, partitions, and RLS policies are paid.

The zero-downtime specialists

pgroll

pgroll (Go, from Xata) tackles the genuinely hard one: schema change with zero downtime. It uses the expand/contract pattern, keeping both the old and new schema valid behind versioned views so two versions of your app run side by side during a rollout.

pgroll-migration-flow

Migrations are JSON or YAML operations, not SQL:

{
	"name": "13_set_email_not_null",
	"operations": [
		{
			"alter_column": {
				"table": "orders",
				"column": "email",
				"nullable": false,
				"up": "SELECT CASE WHEN email IS NULL THEN 'unknown@example.com' ELSE email END",
				"down": "email"
			}
		}
	]
}

pgroll start creates a shadow column, backfills it in batches using the up expression, installs triggers so writes to either column propagate to the other, and exposes the new shape in a new versioned schema (public_13_set_email_not_null). Your new release sets search_path to that schema; the old release keeps using the old one. When the rollout is done, pgroll complete drops the old column and the triggers. Until then, pgroll rollback is one command and loses nothing.

The operation set covers the common cases (add, drop, rename, alter column, constraints, indexes, tables, replica identity) plus a sql escape hatch, with the honest caveat that raw SQL comes with no zero-downtime guarantee. Postgres 14 and up, including RDS and Aurora. Apache-2.0, ~6,600 stars, on the 0.16 line (0.16.3 in September 2026).

Where it stops: your app has to set search_path per connection, which is a code change, and the view layer means \d orders in psql doesn't show you what the app sees. You don't need it until a plain ALTER TABLE on a hot 40-million-row table would page someone, and then you very much do.

Reshape

Reshape got there first with the same view-based idea, in Rust. start sets up the views and triggers so both schemas work, you roll out the app gradually, and complete drops the old schema. Migrations are TOML or JSON actions, with helper libraries for Rust, Ruby, Python, and Go that run the schema-selection query on connect. The same NOT NULL change as the pgroll example:

[[actions]]
type = "alter_column"
table = "orders"
column = "email"
up = "COALESCE(email, 'unknown@example.com')"

	[actions.changes]
	nullable = false
reshape

I said in the July version of this post that Reshape was winding down. The release log says otherwise: the author restarted in January 2026 after a two-year gap and shipped 0.9 through 0.11.2 by September, adding partial and expression indexes, check constraints, foreign-key actions, and a reshape docs command meant to be read by coding agents. There's also a hosted platform (Specific) that runs the start/complete dance on deploy. Postgres 12 and up, MIT, ~1,900 stars.

Where it stops: one maintainer against Xata's team, and a smaller operation catalog than pgroll's. Choosing today, pgroll is the safer bet. Reshape is the one to watch if you want an agent to own the expand/contract loop.

The governance layer

Bytebase

Full disclosure: Bytebase is ours, and the one multi-engine tool on the list, so read this with the appropriate grain of salt. Think GitHub or GitLab for database changes, where developers and DBAs collaborate through a GUI or a GitOps workflow. Go and TypeScript, ~14,700 stars, 3.24 as of November 2026.

issue-detail

On Postgres, the SQL review rules are the part that maps to the four questions. They catch the same footguns Squawk lints for, with two differences: the rule set is attached to an environment, so prod can be stricter than dev, and a failed check gates the rollout instead of failing a CI job. Whoever wrote the migration, engineer or agent, gets told before it reaches production, not by the pager after.

sql-review

It supports both styles: migration files via GitOps, and a state-based workflow where you commit the desired schema and it generates the diff. Statements run in a transaction by default, with a per-plan toggle for the CONCURRENTLY case. Rollback is split the way Postgres splits it: a data change gets a pre-change backup and a one-click rollback, a schema change rolls back to an earlier recorded version. Around the change: an approval flow (rollout permissions per environment on every tier, risk-based approval on Enterprise), one issue that rolls the same change through dev, staging, and prod, and change history. On the query side, a SQL Editor with access control and, on Enterprise, dynamic data masking. And the audit log (7 days on Pro, unlimited on Enterprise), which is what most teams actually come asking for: who ran which statement, against which database, when, for migrations and ad-hoc queries alike, exportable to your SIEM. The tools above can only ever log the migrations, because they never see the ad-hoc side.

sql-editor

Where it stops: Bytebase does not do expand/contract on Postgres. Its online schema change integration is MySQL-only (gh-ost), so a hot-table rewrite on Postgres is still pgroll's job, run under Bytebase's review if you want both. See how to build a CI/CD pipeline for database schema migration.

Summary

ToolApproachPostgres-onlyLicense
graphile-migrateRoll-forward SQLYesMIT
pgschemaDeclarativeYesApache-2.0
pgrollExpand/contractYesApache-2.0
ReshapeExpand/contractYesMIT
BytebaseGoverned platformNoMIT core + paid

My take

If your team thinks in desired state, pgschema: the only declarative tool that sees your RLS policies, partitions, and grants for free, with the transaction and lock-timeout decisions made for you. If you'd rather write migration files, graphile-migrate if you accept its no-rollback opinion, node-pg-migrate if you want a builder API. Either way, put Squawk in CI on day one. The day you have a table too hot to ALTER, add pgroll next to whichever you chose.

Once more than a couple of people touch production, the bottleneck stops being which tool applies the SQL. It becomes who's allowed to run a change, who approved it, and what actually ran. None of the Postgres-native tools above attempt that. Bytebase is built around it: SQL review, per-environment rollout, and change history in the MIT core, the audit log and risk-based approval on the paid tiers. Pair it with whichever tool above applies your SQL, or let it apply the SQL too.

It matters more now that AI agents write migrations. An agent can produce a plausible ALTER TABLE in seconds, and it will never be the one paged when that statement locks a hot table. So it needs what any engineer needs: its own identity instead of a shared credential, a review gate before production, and an audit trail afterwards. Same layer, for people and agents alike, and it's why we built Bytebase.

Back to blog

Explore the standard for database governance

Ask ChatGPT about Bytebase

Get an independent take on whether Bytebase fits your team.

Ask ChatGPT