1

EDIT: This apparently is effecting trying to upgrade or create a new revision file as well.

I've been trying to run a downgrade in Alembic, which I have gotten to work before, with no luck. My current revision ID never changes and I was wondering if anyone could help me figure out why? It's not like I am getting an error or any kind of message that might help me understand what is going wrong. All I see is the following

INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.

Things I've tried: Just running downgrade, downgrade -1, downgrade -5, downgrade 'revision_id'. All other commands (like show) appear to be working as expected, so I honestly have very little to go on.

Know I'm no expert with Alembic, so I'm likely missing something simple.

Thanks in advance.

J. Finn
  • 129
  • 1
  • 11

2 Answers2

2

Found the issue. We have a database table that holds the current revision id. That had gotten out of sync in my copy of the DB. Once I had updated that, everything started working again.

J. Finn
  • 129
  • 1
  • 11
0

I was also facing the same issue, it was due to the wrong alembic version in the alembic_version table. Fixed the issue by

  1. dropping the alembic_version table
  2. run flask db stamp head

Now the alembic_version table points to the current migration version and now you can perform migrate, downgrade, upgrade as required.