Alembic Migration Patterns Audience: Python developers working with SQLAlchemy databases Goal: Provide migration patterns for safe schema evolution with Alembic Alembic Setup alembic/env.py Configuration Async Configuration Migration Commands Migration File Structure Common Operations Add Column Add Non-Nullable Column (Safe Pattern) Rename Column Add Foreign Key Data Migration Safe Migration Patterns Zero-Downtime Deployments 1. Add column : Always nullable first, backfill, then constrain 2. Remove column : Deploy code ignoring column first, then drop 3. Rename column : Add new, copy data, d…