drizzle-migrate

Generate and apply SQL migrations from TypeScript Drizzle schemas.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/theslashdojo/dojo --skill drizzle-migrate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-migrate
Source: https://github.com/theslashdojo/dojo/tree/main/nodes/drizzle/migrate
Command: npx skills add https://github.com/theslashdojo/dojo --skill drizzle-migrate

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires drizzle-kit, and includes scripts (resource) components.

What problem does it solve?

Evolving and applying database schema changes is error-prone and difficult to audit across environments; this Skill provides a repeatable workflow to generate, review, and apply SQL migrations derived from TypeScript Drizzle schemas so teams can manage schema drift safely.

Core Features & Use Cases

  • Generate audited SQL migrations by diffing TypeScript schemas and producing migration folders with migration.sql and snapshot.json for review.
  • Apply and track migrations against a target database using migrate, with a journal to prevent reapplication and ensure ordered execution.
  • Push and pull workflows for rapid prototyping and database-first introspection, plus programmatic runtime migration support for startup or serverless deployments.
  • Use Case: A backend team modifies the schema, generates a named migration, reviews SQL for destructive changes, and then applies migrations in CI and production with predictable ordering.

Quick Start

Run the generate command to produce a reviewed SQL migration file and then run migrate to apply pending changes to your database.

Frequently Asked Questions about drizzle-migrate

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

FAQPage Schema
How do I generate SQL migrations from TypeScript Drizzle schemas?

To generate SQL migrations from TypeScript Drizzle schemas, run a generate command that diffs your schema files and produces a migration folder containing migration.sql and snapshot.json artifacts for review.

What is the best way to apply pending Drizzle database migrations in production?

The best way to apply pending Drizzle database migrations in production is to run the migrate command, which executes pending SQL changes against a target database using a journal to ensure ordered execution and prevent reapplication.

Does drizzle-kit support pushing schema changes directly without intermediary files?

Yes, drizzle-kit supports push workflows for rapid prototyping that apply TypeScript schema changes directly to the database, alongside pull workflows for database-first introspection, bypassing the standard migration file generation.

Can I run Drizzle schema migrations programmatically in serverless deployments?

You can run Drizzle schema migrations programmatically in serverless deployments by integrating runtime migrator calls, allowing startup migrations to execute directly within your application lifecycle without relying solely on CLI scripts.

How do I audit Drizzle migrations for destructive SQL changes before applying them?

To audit Drizzle migrations for destructive SQL changes, generate a named migration to create a migration.sql file, then manually review the SQL diff prior to applying the changes across development, staging, or production environments.