windows 10 reset django migrations
Open a command prompt and navigate to the directory of your Django project.
Run the following command to delete the database migration files:
del /s /q myapp\migrations
Replace "myapp" with the actual name of your app.
- Next, delete the database file itself. If you're using SQLite, the database file is typically named db.sqlite3. Use the following command to delete it:
del /q db.sqlite3
- After removing the migration files and the database file, you can re-create the initial migration for your app by running the following command:
python manage.py makemigrations myapp
Replace "myapp" with the actual name of your app.
- Finally, apply the initial migration to create the database schema:
python manage.py migrate