Agent skill · software engineering · aj-geddes
data-migration-scripts
Create safe, reversible database migration scripts with rollback capabilities, data validation, and zero-downtime deployments. Use when changing database schemas, migrating data between systems, or performing large-scale data transformations.
Why this skill is useful
Provides detailed patterns and scripts for safe, reversible database migrations that the AI wouldn't reliably generate on its own.
What it needs
Requires alembic, knex installed locally. About 2k tokens when loaded. Last updated 2026-03-04. 307 stars on the source repository.
What this skill does
Data Migration Scripts Table of Contents Overview When to Use Quick Start Reference Guides Best Practices Overview Create robust, safe, and reversible data migration scripts for database schema changes and data transformations with minimal downtime. When to Use Database schema changes Adding/removing/modifying columns Migrating between database systems Data transformations and cleanup Splitting or merging tables Changing data types Adding indexes and constraints Backfilling data Multi-tenant data migrations Quick Start Minimal working example: Reference Guides Detailed implementations in the references/ directory: Guide Contents --- --- Knex.js Migrations (Node.js) Knex.js Migrations (Node.js) Alembic Migrations (Python/SQLAlchemy) Alembic Migrations (Python/SQLAlchemy) Large Data Migration with Batching Large Data Migration with Batching Zero-Downtime Migration Pattern Zero-Downtime Migration Pattern Migration Validation Migration Validation Cross-Database Migration Cross-Database Migration Best Practices ✅ DO Always write both up and down migrations Test migrations on production-like data Use transactions for atomic operations Process large datasets in batches Add indexes after data insertion Validate data after migration Log progress and errors Use feature flags for application code changes Back up database before running migrations Test rollback procedures Document migration side effects Version control all migrations Use idempotent operations ❌ DON'T Run untested migrations on production Make breaking changes without backwards compatibility Process millions of rows in single transaction Skip rollback implementation Ignore migration failures Modify old migrations Delete data without backups Run migrations manually in production
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aj-geddes/data-migration-scripts