The process gets stuck in INFO [alembic.migration] Running upgrade

Migration process to SQLAlchemy ORM for Flask framework gets stuck.

When migrating tables to SQLAlchemy during their update, the process stops at this:

INFO [alembic.migration] Context impl PostgresqlImpl.
INFO [alembic.migration] Will assume transactional DDL.
INFO [alembic.migration] Running upgrade 345552dsb34 -> 3fsdf34423, empty message

Solution 1

In most cases, this is due to the fact that you want to update the table that is currently being used by the application / server.

You need to stop the service that is tied to this table and then the process will be successful.

Solution 2

When it starts alembic it uses application context app, and that, in turn, is busy with the running application.

Add to the application code:

@app.teardown_appcontext
def shutdown_session(exception=None):
db.remove()

This will allow the Alembic to update the data while the application is running.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *