Reset Database In Django

If the migration doesn't work after your models are updated and you are okay with deleting all records in your Database (SQLite), you can consider the following steps.
  1. Delete all files except __init__.py in the application migrations folder
  2. Delete db.sqlite3 file in project folder.
  3. Run python3 ./manage.py make migrations.
  4. Run python3 ./manage.py migrate.
You should be able to see a new db.sqlite3 and start over your work with Database.

Comments

Popular Posts