SQLAlchemy and Alembic 2 · Alembic migrations
Generate a migration
Compare your models with the database and write a migration. Always review the generated file.
alembic revision --autogenerate -m "add users table"
Official SQLAlchemy and Alembic 2 documentation
More alembic migrations commands
- Install Alembic
- Create a migration environment
- Apply migrations
- Undo the last migration
- Check the current revision
- List migrations
All alembic migrations commands · SQLAlchemy and Alembic 2 cheatsheet