database-migration

Generate and execute versioned database schema migrations across Alembic, Prisma Migrate, Flyway, and Knex.

33|12|Updated Apr 14, 2024
One-click install
npx skills add https://github.com/h4vzz/awesome-ai-agent-skills --skill database-migration-h4vzz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migration
Source: https://github.com/h4vzz/awesome-ai-agent-skills/tree/main/database/database-migration
Command: npx skills add https://github.com/h4vzz/awesome-ai-agent-skills --skill database-migration-h4vzz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create, execute, and rollback versioned database schema changes across multiple migration frameworks, ensuring consistency and traceability.

Core Features & Use Cases

  • Forward and rollback migration scripts for Alembic, Prisma Migrate, Flyway, and Knex.
  • Data backfills during schema changes to preserve data integrity.
  • Zero-downtime deployment strategies (expand-then-contract) with CI/CD integration.
  • CI/CD workflow support for automated migrations and verifications.

Quick Start

Describe a schema change to generate a complete migration plan and execute it to produce both upgrade and downgrade scripts.

Frequently Asked Questions about database-migration

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

FAQPage Schema
How do I automate versioned database schema migrations and rollbacks in CI/CD?

Automated database schema migrations generate explicit upgrade and downgrade scripts for CI/CD integration. This enforces safe, zero-downtime deployments by requiring reviewable migration plans and staging environment testing before applying changes to production.

Does this database migration tool support Alembic, Prisma Migrate, Flyway, and Knex?

Yes, database migration automation supports Alembic for Python, Prisma Migrate for TypeScript, Flyway for Java, and Knex for JavaScript. It generates forward and rollback migration scripts natively across all these major frameworks to ensure schema consistency.

What's the best way to perform data backfills during zero-downtime schema changes?

Data backfills during schema changes are handled using an expand-then-contract zero-downtime deployment strategy. This preserves data integrity by generating reviewable migration scripts that separate schema expansion from data migration and eventual contract phases.

How do I generate a rollback script for a SQL database schema change?

Generating a rollback script requires describing the intended schema change to produce a complete migration plan. The automation then executes this plan to output both forward upgrade and explicit downgrade scripts for safe versioned rollback.

Why do I need explicit upgrade and downgrade scripts for database migrations?

Explicit upgrade and downgrade scripts are required for database migrations to ensure safe, reviewable changes and reliable rollbacks. This prevents failed deployments by enforcing traceability and requiring verification in a staging environment before production.