push
Generate and migrate in a single step.
push is a convenience command that combines generate and migrate into one call. It diffs your schema, creates a new migration, and immediately applies it to the database.
Usage
- npm
- pnpm
- Bun
- Yarn
npx durcno push [--config path/to/durcno.config.ts]
pnpm dlx durcno push [--config path/to/durcno.config.ts]
bun x durcno push [--config path/to/durcno.config.ts]
yarn dlx durcno push [--config path/to/durcno.config.ts]
Common options
--config <path>— Path to config file (defaults todurcno.config.ts).
What it does
- Runs
generateto compare your current schema with the last recorded snapshot. - Then runs
migrateto apply any pending migrations.
Example
- npm
- pnpm
- Bun
- Yarn
npx durcno push
pnpm dlx durcno push
bun x durcno push
yarn dlx durcno push
When there are schema changes:
Migration 2026-02-26T10-15-30.456Z created at migrations/2026-02-26T10-15-30.456Z.
[SUCCESS] Migration 2026-02-26T10-15-30.456Z applied.
When the database is already up to date:
No changes detected. Skipping migration creation.
Tips
- Use
pushduring local development for a fast generate-and-apply workflow. - For production, prefer running
generateandmigrateseparately so you can review the generatedup.tsanddown.tsbefore applying.
Next: roll back a migration with npx durcno down.