user11757066
user11757066

Reputation:

Django: no migrations apply, but I have unapplied migrations

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

Upvotes: 2

Views: 5832

Answers (3)

Trinh Hieu
Trinh Hieu

Reputation: 805

run the following command on your command prompt:

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

enter image description here

Upvotes: 0

user11757066
user11757066

Reputation:

The solution was to disable the environment.

I don't know why.

Upvotes: 1

Lawrence DeSouza
Lawrence DeSouza

Reputation: 1025

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

Upvotes: 0

Related Questions