Django: no migrations apply, but I have unapplied migrations

Viewed 3428

I deleted my database and tried to create a new one. I did:

  1. python manage.py makemigrations
  2. python manage.py migrate

Then I ran python manage.py runserver and it returned

You have 2 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): social_django.
Run 'python manage.py migrate' to apply them.

Then I ran python manage.py migrate and it returned

Operations to perform:
  Apply all migrations: admin, auth, contenttypes, sessions, social_django
Running migrations:
  No migrations to apply.

I am using django 3.0.7 and social-auth-app-django 4.0.0

3 Answers

The solution was to disable the environment.

I don't know why.

You can check to see which migrations have been done by viewing your database with whichever program you use to do that. And checking the django_migrations table.

The migrations that need to be applied will still be in the migrations folders for the apps that haven't been updated. To get them migrated, assuming they're still in your installed_apps in your settings.py, simply delete the migrations (probably __init__.py) from the migrations folders and re-run :

> python manage.py makemigrations
> python manage.py migrate

run the following command on your command prompt:

1.python manage.py migrate
2.python manage.py runserver

enter image description here

Related