Why does Django still display migrations when none exist?
I'm trying to reset my migrations and start off fresh but I'm getting this really strange issue I can't seem to fix. I started off by deleting the Migrations folder and Deleting every table in Database I'm using (for context it's a MySQL database and I'm using MySQL Workbench to access it). Now after doing so I ran the python manage.py showmigrations
command and it keeps showing me all the old migrations even though none should exist.
Here is what I tried to do to fix this issue:
- I tried to restart the server multiple times with every change or action I did
- I deleted and created the database again with the same name
- I deleted and created the database again with a different name
- I created an empty Migrations folder in hopes that maybe it would fill up the folder with the files but it does not, and now I have an empty Migrations folder and still an empty database with no tables
- I deleted all the
__pycache__
folders I could find
I know this isn't database-sided because I re-created the database with a different name as mentioned. I know there is something that is keeping all this data stored even though the Migrations folder is empty and the Database is empty with no tables. How do I fix this?
I found a fix for this by recreating the following steps:
- Delete the migrations folder
- run
python manage.py makemigrations --empty <app_name>
When I did this then ran the makemigrations command again it detected all my changes and carried out the migration successfully after running python manage.py migrate
.