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 schema fingerprint (ensures schema files haven't changed since plan)
- Displays the planned changes
- Tests local database connection
- Applies infrastructure SQL from
db/schema/infra/ - Wraps the plan SQL and creates a dbmate migration file (staged in
.postkit/db/session/) - Runs
dbmate migrateon the local database - Applies grant statements from
db/schema/grants/ - Applies seed data from
db/schema/seeds/
Resume support: If grants or 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)