PostgreSQL schema planning for rolling deployments

The safe path
is more than an ALTER.

onwardpg generates the compatibility window around your application deployment—then proves the edited plan on disposable PostgreSQL.

$brew install jokull/tap/onwardpg
A traveler surveying a path through a distant PostgreSQL landscape
01 Survey the whole path before taking the first step.

Schema equality is the destination.
Compatibility is the route.

Most diff tools answer what SQL makes two schemas equal. onwardpg also asks what old and new application code encounter along the way.

Your deployment sits in the middle—where it belongs.

01

Expand

Add the compatible surface while old code is still live.

02

Deploy

Ship one application version that understands both shapes.

03

Drain

Wait for old instances, workers, queues, and writes to finish.

04

Contract

Remove compatibility objects and converge on the desired schema.

Understand the deployment contract
add-booking-status / plan
$ onwardpg plan add-booking-status

 compared accepted history → desired DDL
 projected PostgreSQL dependency graph
 decision required: application contract

EXPAND
  ALTER TABLE "app"."bookings"
    ADD COLUMN "status" text;

—— deploy application, then drain old traffic ——

CONTRACT
  ALTER TABLE "app"."bookings"
    ALTER COLUMN "status" SET NOT NULL;

 disposable replay converged

SQL you can inspect.
Decisions you can explain.

The bundle receipts every hint, edit, hazard, assertion, and PostgreSQL major. Product-specific work stays editable; stale answers fail.

  • Forward-only expand and contract SQL
  • Fingerprint-bound human decisions
  • Boolean data assertions
  • Empty residual diff required
See what verification proves

Built for the uncomfortable changes.

01

Catalog-native

PostgreSQL is the parser

Materialize authoritative DDL, inspect typed catalogs, and order work from real dependency edges.

02

Application-aware

Plan the compatibility window

Renames, casts, backfills, policies, and required columns carry the decisions that catalogs cannot make.

03

Proof-oriented

Replay before acceptance

Every edited bundle runs in restricted disposable PostgreSQL and must finish with no residual diff.

Works after your framework, not instead of it.

Export complete PostgreSQL DDL from the tool you already use. onwardpg takes it from there.

Survey the route.
Then move onward.