Can't migrate or upgrade database with Flask-Migrate (Alembic)

后端 未结 4 638
说谎
说谎 2021-02-13 07:21

I\'ve been using Flask-Migrate (Alembic) for updating my database. I updated my models.py file however I made an error. I ran a migration and went to upgrade the da

4条回答
  •  生来不讨喜
    2021-02-13 08:05

    I feel like the accepted answer is a little over-complicated. I had this same issue and the way that I solved it was to simply delete the migration that contained the coding errors. You don't need it anyways since, again, it was coded incorrectly. Find the latest migration in the migrations/versions folder, delete it, then run your migration again and upgrade. You don't need to delete the data in your database just to migrate it.

提交回复
热议问题