{"library":"alembic","type":"library","category":null,"description":"Database migration tool for SQLAlchemy. Manages schema versioning via migration scripts. Current version: 1.18.4 (Mar 2026). Tightly coupled to SQLAlchemy — version mismatch causes silent failures. SQLAlchemy 1.3 dropped in Alembic 1.15. Python 3.8 dropped in Alembic 1.15. The #1 footgun: autogenerate generates empty migrations when target_metadata is not correctly set in env.py.","language":"python","status":"active","version":"1.18.4","tags":["alembic","sqlalchemy","migrations","database","python","schema"],"last_verified":"Tue Jun 09","install":[{"cmd":"pip install alembic","imports":["# In alembic/env.py — MUST import your models for autogenerate to work\nfrom myapp.models import Base  # import all models so metadata is populated\ntarget_metadata = Base.metadata\n\n# If models are in multiple files, import them all:\nfrom myapp.models.user import User\nfrom myapp.models.post import Post\n# then:\ntarget_metadata = Base.metadata","# CLI commands — run from project root\nalembic init alembic          # create alembic directory\nalembic revision --autogenerate -m 'initial'  # generate migration\nalembic upgrade head           # apply all pending migrations\nalembic downgrade -1           # roll back one migration\nalembic history                # show migration history\nalembic current                # show current DB version"]}],"homepage":"https://alembic.sqlalchemy.org","github":"https://github.com/sqlalchemy/alembic","docs":"https://alembic.sqlalchemy.org/en/latest/","changelog":"https://alembic.sqlalchemy.org/en/latest/changelog.html","pypi":"https://pypi.org/project/alembic/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":3.6,"avg_import_s":null,"wheel_type":"wheel"},"url":"https://checklist.day/v1/registry/alembic/compatibility"}}