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)
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
:
mysql> SELECT * FROM alembic_version;
+-------------+
| version_num |
+-------------+
| c8ad125e063 |
+-------------+
1 row in set (0.00 sec)
Hint: Use the command SHOW TABLES
if it's a SQL based database to see the tables.
To solve your problem simply use the command:
DROP TABLE alembic_version;
Or whatever the name of database version table is. And then you need to re-init the migration folder using the command:
python manage.py db init
And then creating a new migration:
python manage.py db migrate
And then you should be good to go with working migrations in alembic.