[Solved] flask db migrate execute error: ERROR [flask_migrate] Error: Can‘t locate revision identified by ‘8d1ad59dc71a‘

Recently, a new table has been added to the flash project, but an error is reported when executing flash DB migrate, as shown in the following figure:


Google around the Internet and finally know the problem:
although the migration directory in the project has been deleted, the version information has been saved in the database. Yes, this is the table – alembic_ version

So all you have to do is delete the version record of this table:

After deletion, execute flash DB migrate again, no error is reported, and the table is generated normally ~

Read More: