SQLAlchemy and Alembic 2 · Alembic migrations
Create a migration environment
Create the alembic folder and alembic.ini. Point env.py at your models' metadata.
alembic init alembic
Official SQLAlchemy and Alembic 2 documentation
More alembic migrations commands
- Install Alembic
- Generate a migration
- Apply migrations
- Undo the last migration
- Check the current revision
- List migrations
All alembic migrations commands · SQLAlchemy and Alembic 2 cheatsheet