managing-database-migrations
Installation
SKILL.md
Database Migration Manager
Overview
Create, validate, and execute database schema migrations with full rollback support across PostgreSQL, MySQL, and MongoDB.
Prerequisites
- Database credentials with DDL permissions (CREATE, ALTER, DROP TABLE)
- Migration framework installed and configured (Flyway, Alembic, Prisma, Knex, or raw SQL versioning)
- Version control for migration files (Git repository)
- Access to a staging database matching production schema for testing migrations
psqlormysqlCLI for executing and verifying migrations- Current schema baseline documented or captured via
pg_dump --schema-only
Instructions
-
Capture the current schema state before making changes. Run
pg_dump --schema-only -f schema_before.sql(PostgreSQL) ormysqldump --no-data > schema_before.sql(MySQL) to create a reference point. -
Define the desired schema change clearly: specify table name, column additions/removals/modifications, constraint changes, and index updates. Document whether the change is additive (safe) or destructive (requires data migration).
Related skills