{"id":923,"hash":"3ce949c67886190b9f7bd08fff8a5f3457c0c9fe064b2a86cd07233eb1403be2","pattern":"alembic util command error can&#39;t find identifier","full_message":"I'm trying to use alembic to handle local migrations on my project. It worked the first time, but then I needed to delete the folder and restart.(don't ask why, I just had to) I'm following this tutorial and I run the command\n\npython manage.py db init\n\nAnd it was ok. But when I try to run\n\npython manage.py db migrate\n\nI'm getting this error:\n\nalembic.util.CommandError: Can't locate revision identified by '31b8ab83c7d'\n\nNow, it seems that alembic is looking for a revision that doesn't exists anymore. There is anyway to make alembic forget that file? Or like restart the comparison from None to -> auto-generated again?","ecosystem":"pypi","package_name":"postgresql","package_version":null,"solution":"Alembic stores the version history in your database. Hence it is using the value stored in your database to search for the revision. The version number for my personal database is stored in the table alembic_version: \n\nmysql> SELECT * FROM alembic_version;\n+-------------+\n| version_num |\n+-------------+\n| c8ad125e063 |\n+-------------+\n1 row in set (0.00 sec)\n\nHint: Use the command SHOW TABLES if it's a SQL based database to see the tables.\n\nTo solve your problem simply use the command:\n\nDROP TABLE alembic_version;\n\nOr whatever the name of database version table is.\nAnd then you need to re-init the migration folder using the command:\n\npython manage.py db init\n\nAnd then creating a new migration:\n\npython manage.py db migrate\n\nAnd then you should be good to go with working migrations in alembic.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/32311366/alembic-util-command-error-cant-find-identifier","votes":86,"created_at":"2026-04-19T04:52:00.973899+00:00","updated_at":"2026-04-19T04:52:00.973899+00:00"}