drizzle-migration

Generate and apply Drizzle Kit SQL migrations from TypeScript schema changes.

7|2|Updated Nov 9, 2025
One-click install
npx skills add https://github.com/Dexploarer/hyper-forge --skill drizzle-migration-dexploarer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-migration
Source: https://github.com/Dexploarer/hyper-forge/tree/main/.claude/skills/drizzle-migration
Command: npx skills add https://github.com/Dexploarer/hyper-forge --skill drizzle-migration-dexploarer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides through the Drizzle Kit database migration workflow, automating schema changes and ensuring data consistency. It prevents manual SQL errors, streamlines schema evolution, and maintains a reliable database state for the asset-forge project.

Core Features & Use Cases

  • Migration Generation: Automatically generates SQL migration files from TypeScript schema changes.
  • SQL Review Guidance: Provides a checklist for reviewing generated SQL before application, preventing unintended changes.
  • Migration Application: Guides through applying migrations to the database and verifying changes with Drizzle Studio.
  • Use Case: After modifying a Drizzle schema file (e.g., adding a description field to the teams table), use this skill to "create a database migration." It will generate the SQL, prompt you to review it, apply it, and suggest verifying with Drizzle Studio.

Quick Start

Generate a Drizzle Kit migration for recent schema changes in server/db/schema/.

Frequently Asked Questions about drizzle-migration

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

FAQPage Schema
How do I generate database migrations from TypeScript schema changes?

Database migrations are generated automatically from TypeScript schema changes using Drizzle Kit. Run `bun run db:generate` after modifying your schema files in `packages/asset-forge/server/db/schema` to create SQL migration files that Drizzle Kit outputs to your migrations directory.

Can I use Drizzle Kit migrations with PostgreSQL and SQLite?

Yes, Drizzle Kit migrations work with both PostgreSQL and SQLite. The schema changes you define in TypeScript compile to compatible SQL for either database, controlled by your Drizzle Kit configuration and the DATABASE_URL in your .env file.

What should I check before applying a migration to production?

Before applying migrations, review the generated SQL for correctness and unintended changes using a checklist: verify column modifications, constraint changes, and data transformations. Apply migrations to development first via `bun run db:migrate`, then verify results in Drizzle Studio before promoting to production.

How do I apply migrations to my database?

Apply migrations using `bun run db:migrate` with DATABASE_URL configured in your .env file. This executes pending migration files against your database in order, updating your schema and maintaining a migration history for rollback and auditing.

What happens if I modify a schema file but forget to generate a migration?

If schema changes aren't migrated, your TypeScript schema definition diverges from your actual database state, causing runtime errors or data inconsistencies. Always run `bun run db:generate` after schema modifications to keep migrations in sync with your code.

Does Drizzle Kit support schema evolution for complex databases?

Drizzle Kit supports schema evolution including adding fields, modifying columns, and managing constraints through TypeScript schema definitions. For the asset-forge project, it automates migration generation from schema changes, though complex transformations require reviewing and potentially editing generated SQL manually.