Hi guys, I have a problem with makemigration, when I enter 'python manage.py makemigration', it's return me ( No changes detected) help me?
I know this commonly solved by deleting de sqlite3 DB that is used in the development process.
Also, I know this question is currently solved, but I want to leave my case here as an alternative.
Sometimes while we are programming we change a lot of things in our models. When we run python manage.py makemigrations a file is created inside of our app folder/migrations. And when we run python manage.py migrate a record in the table django_migrations is created. this record contains 3 fields we must check in detail:
1 - name (this is the file name created in the migrations app folder)
2 - app (this is the name of our app. Also works like a namespace to prevent conflicts)
3 - applied (this is the date-time when the migration was executed).
If you've modified your model previously, you should have several files inside migrations (amount accordingly with the times you've executed makemigrations on every change), in my case I wanted to erase these files just to have only one migration file.
The problem with this is that when makemigrations was run again it creates a file 0001_initial.py. If you remember the table django_migrations contains a log of this file, this is to prevent the execution of migrations that already have been done.
If this is your case, you would erase the records of your app migrations from this table.