drizzle-migrations

Generate, validate, and apply Drizzle ORM database migrations from schema changes.

198|19|Updated Sep 15, 2025
One-click install
npx skills add https://github.com/iterate/iterate --skill drizzle-migrations-iterate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-migrations
Source: https://github.com/iterate/iterate/tree/main/.agents/skills/drizzle-migrations
Command: npx skills add https://github.com/iterate/iterate --skill drizzle-migrations-iterate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you create and run safe, repeatable Drizzle ORM database migrations by guiding you through schema changes, migration generation, review, and verification.

Core Features & Use Cases

  • Schema-first migration workflow: Update the Drizzle schema file in the target package before generating migrations.
  • Generated SQL review with guardrails: Review and optionally adjust the generated .sql while explicitly avoiding manual edits to Drizzle journal/snapshot files.
  • Local verification and execution: Use Drizzle’s check and migrate commands to validate and apply migrations consistently.

### Quick Start Run drizzle-kit generate from the package directory after editing the package’s src/db/schema.ts file for the change you want.

Frequently Asked Questions about drizzle-migrations

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

FAQPage Schema
How do I generate and apply Drizzle ORM database migrations safely?

To generate Drizzle ORM database migrations safely, edit the target package's `src/db/schema.ts` file first, then run `drizzle-kit generate` to create the SQL, and `drizzle-kit migrate` to apply it locally.

What is the correct workflow for updating a Drizzle schema and creating a migration?

The correct workflow for Drizzle schema updates is schema-first: modify the schema definitions, generate the migration SQL, review the output, and validate it using `drizzle-kit check` before running `drizzle-kit migrate`.

Can I manually edit Drizzle journal or snapshot files after generating a migration?

You should never manually edit Drizzle `_journal.json` or `*_snapshot.json` files. You can review and adjust the generated `.sql` file, but the journal and snapshot files must remain untouched to maintain migration integrity.

How do I validate generated SQL before running a Drizzle database migration?

To validate generated SQL before a Drizzle database migration, run the `drizzle-kit check` command from the owning package directory to verify the migration state and ensure consistency with your schema definitions.

Does this migration workflow support editing the generated SQL directly?

Yes, the Drizzle migration workflow supports reviewing and optionally adjusting the generated `.sql` file. This allows you to verify the SQL output while ensuring you avoid manual edits to internal Drizzle journal and snapshot files.