
alembic-migration-manager
A skill for managing database migrations with Alembic. Use this for tasks involving Alembic initiali
by MUmerRazzaq|Open Source
Alembic Migration Management
This skill provides a comprehensive guide to managing database schema and data migrations using Alembic.
Core Workflow
-
Initialization & Configuration: Set up Alembic for a new project.
- See
references/01_initialization_and_configuration.mdfor detailed setup instructions and configuration templates.
- See
-
Generating Migrations: Create new migration files.
- See
references/02_generating_migrations.mdfor guidance onautogeneratevs. manual creation.
- See
-
Writing Migration Scripts: Implement the upgrade and downgrade logic.
- See
references/03_migration_script_patterns.mdfor common patterns and examples (creating tables, adding columns).
- See
-
Handling Data Migrations: Perform data backfilling or transformations.
- See
references/04_data_migrations.mdfor patterns and safety checks.
- See
-
Testing & CI/CD: Ensure migrations are safe and automated.
- See
references/05_testing_and_ci_cd.mdfor testing strategies and CI/CD integration examples.
- See
-
Deployment & Rollbacks: Manage migrations in production.
- See
references/06_rollbacks_and_production.mdfor a production checklist and a rollback playbook.
- See
Bundled Resources
- Configuration Templates:
assets/alembic.ini.template: A ready-to-use template foralembic.ini.assets/env.py.template: A template forenv.pyto connect to your database and models.