Alembic Database Migration Tool
alembic.sqlalchemy.org
2
Leaving SiteNav
External Link Disclaimer
You are about to visit alembic.sqlalchemy.org. This website is not operated by us. We are not responsible for its content or privacy practices.
About this website
Alembic is a lightweight database migration tool for usage with the SQLAlchemy Database Toolkit for Python, created by SQLAlchemy author Michael Bayer and maintained as part of the SQLAlchemy project. The tool provides a framework for generating and applying schema changes to relational databases in a controlled, versioned manner. Unlike declarative migration tools that auto-detect model changes, Alembic uses an explicit migration scripts approach where each migration is a Python script with upgrade and downgrade functions, giving developers full control over the migration logic. Alembic supports auto-generation of migration scripts by comparing the current database schema against SQLAlchemy model definitions, detecting changes such as new tables, added or removed columns, foreign key modifications, index changes, and constraint additions. The generated scripts serve as starting points that can be manually refined for complex transformations including data migrations alongside schema changes. Alembic supports all databases supported by SQLAlchemy including PostgreSQL, MySQL, SQLite, Oracle, Microsoft SQL Server, and Firebird. The tool maintains a version tracking table in the database to record which migrations have been applied, enabling forward and backward migrations. Alembic supports multiple database environments (development, staging, production) through configuration files, offline migration generation for review, and programmatic API access for embedding in deployment scripts.
Statistics
2
Views
0
Clicks
0
Like
0
Dislike