I run python manage.py makemigrations
and I get:
No changes detected
Then, python manage.py migrate
and I get:
No migrations to apply.
So, I always run into this sort of problem, so today I decided to try and work it out at the database level. Thing is, I changed a model field name which Django
didn't bother reflecting in a migration file. I only found out later when I ran into problems. I later looked at the migration files and discovered there was no migration for that change. But I didn't notice because I made other changes as well, so once I saw a migration file I was happy.
My advice. Create migration for each change one at a time. That way you get to see if it happened or not.
So here's my working through it in MySQL.
open mysql console.
show databases; # see all my dbs. I deleted a few
drop database ; # if needed
use ; # the database name for your django project
show tables; # see all tables in the database
DESCRIBE ; # shows columns in the database
SHOW COLUMNS FROM ; # same thing as above
ALTER TABLE CHANGE ; # now I manually updated my column name
If you're using postgresql, just google the corresponding commands.