Broke my Flask-sqlalchemy sqlite db instance

111 Views Asked by At

While testing my Flask applications functionality i somehow broke my db by editing my models during up/downgrading. I am using Migrate for this purpose but i am fairly new to it. which leads to my question: How do I completely reset my db(Migrate revisions). Before when something like this happened i would just downgrade to init state and manually delete all python files from Migrate/versions folder.

1

There are 1 best solutions below

0
On

Found a solution:

  1. just delete whole migrations folder
  2. do flask db init
  3. check if migrations folder was created(check all necessary files from screenshot) Screenshot of necessary files in migrations folder

4. flask db migrate 5. flask db upgrade Now you have an db matching the models from your application