I made a new app called 'contact' which I added to installed_apps, but I can't create a table in the SQLite database!
Django version = 3.1
python manage.py makemigrations contact
No changes detected in app 'contact'
then for : python manage.py migrate contact
Operations to perform: Apply all migrations: (none) Running migrations: No migrations to apply.
I have tried many solutions proposed by members here but None worked
like checking "init" file existed in migrations folder and it's empty or commands like these :
python manage.py migrate --fake contact zero
Operations to perform: Unapply all migrations: contact Running migrations: No migrations to apply.
python manage.py migrate contact --fake-initial
Operations to perform: Apply all migrations: (none) Running migrations: No migrations to apply.
This worked for me;
python manage.py makemigrations --empty yourappname
python manage.py migrate yourappname
It turns out adding an extra empty migration forces django to recheck the table and in the process, it noticed the new migrations. There's probably some caching taking place somewhere.
Original answer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With