drizzle-kit-flow

Guides Drizzle Kit schema changes, migrations, and production database deployment workflows.

Updated Dec 21, 2025
One-click install
npx skills add https://github.com/Angael/veles --skill drizzle-kit-flow-angael
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-kit-flow
Source: https://github.com/Angael/veles/tree/main/.agents/skills/drizzle-kit-flow
Command: npx skills add https://github.com/Angael/veles --skill drizzle-kit-flow-angael

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing Drizzle ORM schema changes safely is error-prone: mixing push and migrate corrupts migration history, editing shipped migrations breaks deployments, and experimental dev changes can leak into production. This Skill enforces a disciplined workflow that keeps disposable dev databases separate from the migration history deployed to production. ## Core Features & Use Cases - Dev Iteration Flow: Iterate on the Drizzle schema with pnpm db:push against a disposable dev database, then generate one clean migration only when the schema is final. - Migration Hygiene: Replace unshipped branch-only migrations with a single clean migration, deleting the migration and its snapshot as one unit without hand-editing snapshots. - Production Safety Rules: Enforces forward-fix migrations, staged deployments for renames/drops/NOT NULL changes, and controlled pnpm db:migrate:prod execution before merging to main. - Use Case: You are adding a new column to a table in the Veles monorepo. The Skill walks you through pushing to the dev database while experimenting, generating and reviewing the final migration, resetting the dev database to verify migrations from scratch, and committing schema and migration together. ## Quick Start Ask the assistant to help you change the Drizzle schema and produce a clean migration for deployment, and it will tell you exactly which pnpm database commands to run and when.

Frequently Asked Questions about drizzle-kit-flow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely change a Drizzle schema during development?

Change the schema and run pnpm db:push against the disposable dev database while iterating. Only when the schema is final, run pnpm db:generate -- --name=<feature> to create one clean migration, then verify with pnpm db:reset before committing.

When should I use drizzle-kit push vs generate and migrate?

Use push only for experimental dev databases during iteration. Use generate plus migrate for anything deployed: push and migrate histories can disagree, so never run migrate on a database already changed with push, and never use push against production.

Can I edit or delete an existing Drizzle migration?

Only if the migration exists solely on your branch and was never deployed or shared. Delete the migration and its snapshot as one unit, then generate one clean replacement. Migrations that reached production must never be edited; add a forward-fix migration instead.

How do I handle destructive changes like column renames or drops in production?

Use compatible staged deployments: add the new shape, migrate data and application usage, then remove the old shape in a later migration. Back up before destructive changes and run pnpm db:migrate:prod as one controlled deployment step.

Why does my Drizzle migration history conflict after using db push?

Running migrate on a database previously changed with push causes the actual schema and the __drizzle_migrations history to disagree. Keep push for disposable dev databases only, and reset with pnpm db:reset to test all migrations from scratch.