drizzle-safe-migrations

Plan and execute Drizzle migrations with data backfills and rollback notes.

1|1|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/rodrigobranas/formacao_ia_arq_t1_4 --skill drizzle-safe-migrations-rodrigobranas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-safe-migrations
Source: https://github.com/rodrigobranas/formacao_ia_arq_t1_4/tree/main/mastra-rag/.agents/skills/drizzle-safe-migrations
Command: npx skills add https://github.com/rodrigobranas/formacao_ia_arq_t1_4 --skill drizzle-safe-migrations-rodrigobranas

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Production-safe Drizzle migration workflow for schema changes that require data backfills or constraint tightening. Use when changing enums/check constraints/defaults, removing status values, or sequencing custom and generated migrations in Drizzle. Trigger on requests about Drizzle migration safety, deployment-safe backfills, migration ordering, and rollback planning.

Core Features & Use Cases

  • Backfill-first migrations to preserve data integrity
  • Generate and order schema migrations with clear rollback notes
  • Deployment-safe planning for enums, checks, and defaults

Quick Start

Describe your change and run the planner to generate backfill and schema migrations in the correct order.

Frequently Asked Questions about drizzle-safe-migrations

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

FAQPage Schema
How do I plan safe Drizzle migrations that require data backfills?

To plan safe Drizzle migrations with data backfills, you generate backfill-first schema changes to preserve data integrity, ensuring constraints and defaults are applied without breaking production deployment rollouts.

When do I need a backfill-first migration workflow for database schema changes?

You need a backfill-first migration workflow when changing enums, check constraints, or defaults, or removing status values, ensuring existing database records comply with new constraints before the schema tightens during deployment.

How do I sequence Drizzle schema migrations and custom backfills during deployment?

Sequencing Drizzle migrations involves ordering backfill and schema migration files correctly, applying data updates before constraint tightening, and validating the ordering to ensure deployment-safe rollouts and accurate rollback planning.

What is the best way to handle rollback planning for Drizzle database migrations?

The best way to handle Drizzle migration rollback planning is to generate schema changes with clear rollback notes, ensuring that deployment rollouts across staging and production can safely revert constraint tightening and backfills.

Does this migration planner support constraint tightening for existing database records?

Yes, the migration planner supports constraint tightening by validating that existing database records satisfy new enums, checks, and defaults through backfill generation before the final schema constraints are enforced.

Why does changing enum values in Drizzle require a deployment-safe migration strategy?

Changing enum values requires a deployment-safe migration strategy because immediate constraint tightening can break existing database records, so backfills must update data across staging and production rollouts before the schema finalizes.