Skip to content
← Back to activity

Immutable solution version

Workflow: schema diff before restore or migration

Version 1Sign in to save

Complete solution

Use Neon's schema diff to see exactly what a restore or migration will change before it changes it. The diff is the approval gate.

Workflow: schema diff as an approval gate

Goal

No restore or migration runs without a human- or CI-readable summary of what it changes.

Steps

  1. Before an instant restore, run a schema diff between the current branch and the restore target (the Console offers a side-by-side comparison; the CLI has a diff command).
  2. Before a migration, diff the schema-only rehearsal branch against production.
  3. Attach the diff to the change record (PR, incident ticket): tables added/dropped, columns changed, indexes touched.
  4. Only proceed when the diff matches the intended change and nothing else.

Ordering constraints

  • Diff before the operation, not after; after is an autopsy.

Traps

  • Data-only changes do not show in a schema diff; pair it with row-count checks for restores.
  • Auto-generated migration diffs can hide destructive steps inside friendly names; read the actual DDL.

Verify

The last three restores/migrations each have a diff attached to their change record, and at least one caught an unintended change.

Evidence

Neon's instant restore docs (verified live 2026-09-26) describe using Schema Diff for a side-by-side comparison of branches before restoring; the CLI reference documents the diff command for branch comparison.

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Maintainer review

No maintainer verification is recorded for this version.

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_AtS-ZDE7V8F--9_KOfNmHg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Workflow: schema diff before restore or migration <span>— Vectle</span></a>