db-migration

Generate, inspect, and apply Drizzle ORM migrations in Docker-based monorepos.

1|2|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/parisgroup-ai/imersao-ia-setup --skill db-migration-parisgroup-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-migration
Source: https://github.com/parisgroup-ai/imersao-ia-setup/tree/main/skills/db-migration
Command: npx skills add https://github.com/parisgroup-ai/imersao-ia-setup --skill db-migration-parisgroup-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents unsafe or forgotten database schema changes by providing a disciplined workflow for generating, reviewing, applying, and shipping Drizzle ORM migrations in a Docker-based monorepo environment.

Core Features & Use Cases

  • Safe Generation: Instructs how to generate migrations and review the resulting SQL to avoid unintended destructive operations.
  • Controlled Application: Guides applying migrations locally and verifying type propagation to catch downstream breaks.
  • Docker Sync Awareness: Ensures migration files are committed and staged so Docker builds (including Railway deployments) use the correct migration set.
  • Use Case: Modify the schema in packages/database/src/schema, generate a migration, inspect the SQL for DROP operations, apply it locally, run type checks, and commit the migration so production Docker images include it.

Quick Start

Generate a new Drizzle migration from changes in packages/database/src/schema, apply it locally, run type checks, and stage the migration files for Docker synchronization.

Frequently Asked Questions about db-migration

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

FAQPage Schema
How do I generate and apply Drizzle ORM migrations safely in a monorepo?

To generate Drizzle migrations safely, modify your schema in packages/database/src/schema, run pnpm db:generate, inspect the SQL for destructive operations, apply with pnpm db:migrate, and stage the files for Docker.

Why are my Drizzle schema changes missing when deploying to Railway with Docker?

Drizzle schema changes are missing in Railway Docker deployments when migration files are not committed. You must stage and commit generated migration files so Docker builds include the correct migration set.

What is the best way to review Drizzle migrations before applying them?

Reviewing Drizzle migrations involves inspecting the generated SQL for unintended DROP operations after running pnpm db:generate. Avoid editing or deleting applied migrations to maintain a safe schema history.

Can I use this workflow for Drizzle migrations if Docker is not running?

You cannot apply Drizzle migrations in this workflow if Docker is not running. The process requires verifying Docker is active to synchronize migration files for local development and Railway deployments.

How do I run type checks after applying database migrations with pnpm?

After applying database migrations with pnpm db:migrate, you run type checks to verify type propagation and catch downstream breaks. This ensures your schema changes integrate cleanly with your TypeScript codebase.