db-migrations

Generate and validate idempotent Drizzle database migration scripts.

1|Updated May 20, 2026
One-click install
npx skills add https://github.com/mDevsLabs/mAI --skill db-migrations-mdevslabs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-migrations
Source: https://github.com/mDevsLabs/mAI/tree/main/.agents/skills/db-migrations
Command: npx skills add https://github.com/mDevsLabs/mAI --skill db-migrations-mdevslabs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams generate, review, and apply database migrations safely, reducing drift and errors during schema evolution.

Core Features & Use Cases

  • Generate and apply idempotent migration scripts with clear journal updates.
  • Validate and synchronize drift between Drizzle schemas and actual database state.
  • Use cases include evolving schemas in CI/CD pipelines and after rebase conflicts.

Quick Start

Run the migration generator to create an initial migration and review generated SQL before applying.

Frequently Asked Questions about db-migrations

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

FAQPage Schema
How do I generate idempotent database migration scripts for Drizzle schemas?

Idempotent database migration scripts for Drizzle schemas are generated by creating an initial migration and validating the resulting SQL before applying it. This ensures deterministic scripts that can be safely executed multiple times without causing errors.

What is the best way to fix schema drift after a git rebase conflict?

Fixing schema drift after a rebase involves regenerating the migration scripts to synchronize the Drizzle schema state. This process validates the changes and updates the migration journal to maintain integrity during continuous integration workflows.

How do database migration journals work during CI/CD workflows?

Database migration journals track applied scripts during CI/CD workflows to maintain state integrity. They record each migration sequence, ensuring deterministic application and preventing drift between the Drizzle schema and the actual database state.

Can I use this to validate drift between my Drizzle schema and the actual database?

Yes, you can validate and synchronize drift between Drizzle schemas and the actual database state. The skill checks for discrepancies during schema evolution and generates the necessary SQL scripts to safely align the database with the expected state.

Does generating database migrations require manual SQL writing for schema changes?

Generating database migrations does not require manual SQL writing for schema, table, or column changes. The process automatically produces the required SQL scripts from the Drizzle schema, allowing you to review the output before safe application.

Why do my database migrations fail when applied multiple times in CI pipelines?

Database migrations fail when applied multiple times if the scripts are not idempotent. Generating idempotent SQL ensures that re-running the same migration scripts safely yields the same result without duplicating data or causing execution errors.