drizzle-safe-migrations

Installation
SKILL.md

Drizzle Safe Migrations

Overview

Use this skill to run database migrations in a way that is auditable, deployment-safe, and consistent with Drizzle's migration model.

Core Rules

  • Always generate schema migrations with the project script (bun run db:generate).
  • Never hand-edit generated schema migration files.
  • Generate data backfills as custom migrations (bun run db:generate -- --custom --name <name>) and edit only that custom SQL file.
  • Apply data normalization before tightening constraints.
  • Keep one-off data fixes in migration history, not as hidden runtime logic, unless an emergency hotfix requires temporary mitigation.

Workflow

  1. Classify the change:
    • schema-only: only column/table/index/default changes.
    • data+schema: old rows must be transformed before new constraints/defaults.
  2. For data+schema, create custom migration first:
Related skills

More from pedronauck/skills

Installs
112
GitHub Stars
360
First Seen
Mar 18, 2026