[Solved] Error: Can‘t locate revision identified by ‘xxx‘

Reason for error: The database version does not match, perhaps the files in the migration folder have changed but the database version is still the same.

Solution:

Delete the migration folder and delete the alembic_version table from the database.

Re-initialize (init, migrate, upgrade) to retain the original data

Read More: