Skip to main content

db plan

Generate a schema diff showing what changes will be applied.

Usage

postkit db plan

Options

OptionDescription
-v, --verboseEnable verbose output
--jsonOutput as JSON

What It Does

  1. Combines all schema files from db/schema/ into a single SQL file (excluding infra/, grants/, seeds/)
  2. Runs pgschema plan to compare against local database
  3. Saves a schema fingerprint (SHA-256 hash of source files) for validation during apply
  4. Displays the migration plan and saves to .postkit/db/plan.sql

Requirements

  • An active session must exist (run db start first)
  • start - Start a session
  • apply - Apply the planned changes