db apply
Apply the planned schema changes to the local cloned database.
Usage
postkit db apply [-f]
Options
| Option | Description |
|---|---|
-f | Skip confirmation prompts |
-v, --verbose | Enable verbose output |
--dry-run | Show what would be done without making changes |
--json | Output as JSON |
What It Does
- Validates per-schema fingerprints (ensures schema files haven't changed since plan)
- Displays the planned changes
- Tests local database connection
- Applies infrastructure SQL from
db/infra/ - For each schema with changes: wraps plan SQL with
SET search_path TO "<name>"and combines into one migration file (staged in.postkit/db/session/) - Runs
dbmate migrateon the local database - Applies seed data from
db/schema/<name>/seeds/for each schema in config order
Resume support: If seeds fail, re-running postkit db apply resumes from where it left off.
Requirements
- An active session must exist
- A plan must exist (run
db planfirst)