Alembic
Alembic provides version-controlled database migration management for support systems built on SQLAlchemy. Create, test, and deploy schema changes across environments while preserving data integrity and enabling safe rollbacks.
Alembic helps you manage and version control database schema changes through automated migration scripts.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-06-13
Alembic helps you manage and version control database schema changes through automated migration scripts. Alembic provides version-controlled database migration management for support systems built on SQLAlchemy. Create, test, and deploy schema changes across environments while preserving data integrity and enabling safe rollbacks.
Use it when
- Alembic manages schema changes through a structured workflow: initialize your project with `alembic init`, define your SQLAlchemy models.
- Yes, Alembic can auto-generate migrations from your SQLAlchemy declarative base models.
Install
manutej/luxor-claude-marketplace/alembic · repository language: Shell
generated, unverified - the skill's exact subdirectory could not be determined; check the repository on GitHub
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What is Alembic and how does it manage database migrations?
Alembic is a database migration tool that provides version-controlled schema change management for SQLAlchemy-based applications. It enables you to create, test, and deploy schema changes across environments while preserving data integrity and enabling safe rollbacks. Alembic tracks all modifications to your database structure, allowing teams to collaborate on schema evolution without manual SQL management.
How do you use Alembic for schema changes in your database?
Alembic manages schema changes through a structured workflow: initialize your project with `alembic init`, define your SQLAlchemy models, auto-generate migration scripts using `alembic revision --autogenerate`, review the generated Python migration files, and apply them with `alembic upgrade head`. Each migration is version-controlled and can be reviewed before deployment, ensuring safe and traceable schema evolution.
Can Alembic auto-generate migrations from SQLAlchemy models?
Yes, Alembic can auto-generate migrations from your SQLAlchemy declarative base models. Using the `alembic revision --autogenerate` command, Alembic compares your current model definitions against the database schema and creates migration scripts that capture the differences. This automation reduces manual SQL writing while maintaining full control through code review before applying changes.
How does Alembic enable rollback and downgrade of database changes?
Alembic tracks database modifications through revision history, allowing you to downgrade or rollback changes using the `alembic downgrade` command. You can revert to any previous schema version by specifying the target revision. Each migration script contains both upgrade and downgrade logic, enabling safe reversal of changes if issues arise during deployment or testing.
What role does env.py play in Alembic configuration?
Alembic's env.py is the core configuration file that controls how migrations execute. It defines database connection settings, logging behavior, and the migration context. You customize env.py to support different environments (development, staging, production), configure SQLAlchemy engine creation, and control whether migrations run in online or offline mode for flexibility in deployment scenarios.
How do you initialize Alembic in a new project?
Initialize Alembic in a new project using `alembic init <directory_name>`, which creates the migration environment with subdirectories for versions, configuration files (alembic.ini and env.py), and templates. Configure the database connection string in alembic.ini, link your SQLAlchemy models to the migration context, then begin creating migrations. This setup establishes version control for all future schema changes.
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Manage and version control database schema changes”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
Master versioned, reversible database migrations that evolve schemas without downtime. Learn Alembic setup, multi-phase column operations, data backfills, and testing strategies to keep applications running during schema changes.
Master database migration techniques including expand-contract patterns, safe index creation, and batch processing for large tables. This skill covers zero-downtime schema changes, foreign key constraints, and rollback strategies using Alembic.
Master Alembic migration patterns for evolving SQLAlchemy database schemas safely. This skill covers initialization, auto-generating migrations from model changes, executing manual data transformations, and deploying schema updates without downtime using proven patterns like nullable-first column additions and concurrent indexing.
SQLAlchemy ORM Expert covers modern ORM patterns, session handling, and query performance tuning tailored for customer support systems. Learn to design robust data models with relationships, leverage async operations in FastAPI, and integrate PostgreSQL effectively. The skill walks through real support scenarios including ticket management, user authentication, and bulk data operations.
Pytest is Python's industry-standard testing framework, built to handle the rigorous demands of customer support systems. This skill covers fixtures, parametrization, mocking, async operations, and database testing with PostgreSQL and SQLAlchemy—everything needed to test ticketing platforms, APIs, and multi-tenant architectures reliably.
Build robust database layers with SQLModel patterns for one-to-many, many-to-many, and self-referential relationships. Manage schema evolution safely using Alembic migrations, from autogenerated changes to complex data transformations. Includes query optimization techniques, inheritance patterns, and production-ready helper scripts.
More skills sqlalchemy (MIT) · crm-cli (MIT)