I am trying to do a migration in django 2.2.4 in python 3.7. First I try to make do makemigations:
python3 manage.py makemigrations
I get:
Migrations for 'main':
main/migrations/0001_initial.py
- Create model TutorialCategory
- Create model TutorialSeries
- Create model Tutorial
But then I try the second step:
python3 manage.py migrate
I get:
Operations to perform:
Apply all migrations: admin, auth, contenttypes, main, sessions
Running migrations:
No migrations to apply.
Even though a migration should happen.
I tried deleting my migrations folder and then remaking it (with the empty __init__.py
file inside) but it still doesn't work.
(Note: I have been following along the tutorial: Linking models with Foreign Keys - Django Web Development with Python p.9 by sentdex)
Somehow your migrations are virtually or faked applied in the database, Truncating django_migrations table should work.
Delete all the migrations files:
find . -path "/migrations/.py" -not -name "init.py" -delete find . -path "/migrations/.pyc" -delete
Truncate table:
truncate django_migrations
makemigrations, migrate.