Paul's Programming Notes     Archive     Feed     Github

Alembic Cheat Sheet - Python/SQLAlchemy

alembic revision --autogenerate -m "<your message>"
alembic upgrade head

Problem: FAILED: Target database is not up to date.
Solution: alembic upgrade head

Problem: No such revision '5000106def16'
Solution: 
  1. sqlite3 db.sqlite3
  2. drop table alembic_version; (and exit, ctrl+d)
  3. alembic upgrade head