drizzle-migration

Generate and apply Drizzle Kit migrations for PostgreSQL or SQLite schema changes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents database schema drift and migration mistakes by guiding you through the correct Drizzle Kit workflow for generating, reviewing, and applying schema changes to the asset-forge database.

Core Features & Use Cases

  • Schema-to-migration generation: Creates new SQL migrations from updated TypeScript schema files in the Drizzle schema directory.
  • Safety-first SQL review: Prompts you to inspect the generated migration SQL to confirm intended changes and avoid accidental drops or incorrect foreign keys.
  • Apply-and-verify workflow: Applies pending migrations and then validates the results using Drizzle Studio to confirm tables, indexes, and constraints are correct.
  • Use Case: After adding a new column (for example, description to a teams table) in server/db/schema/, generate the migration, review the SQL, apply it to the database, and verify the resulting table in Drizzle Studio.

Quick Start

Use this skill when you modify Drizzle schema files and want to run bun db:generate, review the newest SQL migration, then apply it with bun db:migrate.

Frequently Asked Questions about drizzle-migration

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

FAQPage Schema
How do I generate and apply Drizzle migrations after changing my TypeScript schema?

To generate and apply Drizzle migrations, run Drizzle Kit to produce SQL files from your TypeScript schema, review the SQL for safety, execute bun run db:migrate with DATABASE_URL, and verify the database state via Drizzle Studio.

What is the safest way to review SQL generated by Drizzle Kit before migrating?

The safest way to review Drizzle Kit SQL is to inspect the generated migration files directly to confirm intended changes and prevent accidental table drops or incorrect foreign keys before executing bun run db:migrate.

Why does my PostgreSQL database schema drift when using Drizzle migrations?

PostgreSQL database schema drift occurs when TypeScript schema files change but the corresponding Drizzle migrations are not generated and applied, requiring you to run Drizzle Kit to reconcile the database state.

Can I use Bun to execute Drizzle database migrations for PostgreSQL?

Yes, you can use Bun to execute Drizzle database migrations for PostgreSQL by running bun run db:migrate with the DATABASE_URL environment variable set to apply pending SQL changes.

How do I verify database changes after applying a Drizzle migration?

You verify database changes after applying a Drizzle migration by using Drizzle Studio to confirm that tables, indexes, and constraints in the target PostgreSQL database match the expected results.

Does Drizzle Kit support SQLite schema migrations?

Yes, Drizzle Kit supports SQLite schema migrations, allowing you to generate SQL from TypeScript schema files to reconcile database state for both PostgreSQL and SQLite targets.