We're using SQLAlchemy and Alembic (along with Flask-SQLAlchemy and Flask-Migrate). How to check if there are pending migrations?
I tried to check both Alembic's and Flask-Migrate's documentation but failed to find the answer.
You can figure out if your project as at the latest migration with the current
subcommand:
Example output when you are at the latest migration:
(venv) $ python app.py db current
f4b4aa1dedfd (head)
The key thing is the (head)
that appears after the revision number. That tells you that this is the most recent migration.
Here is how things change after I add a new migration, but before I upgrade the database:
(venv) $ python app.py db current
f4b4aa1dedfd
And after I run db upgrade
I get:
(venv) $ python app.py db current
f3cd9734f9a3 (head)
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With