question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deleting all migrations and starting over throwing errors

See original GitHub issue

What happened?

I’m trying to delete all migration files and starting over. But I’m getting this error when running makemigrations:

django.db.migrations.exceptions.NodeNotFoundError: Migration socialaccount.0001_initial dependencies reference nonexistent parent node ('sites', '0001_initial')

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
foarsittercommented, Feb 11, 2019

You have deleted contrib/sites/migrations/* whilst the project settings overrides the contrib.sites migrations. Either revert the deletion of the contrib/sites/migrations/* migrations or remove the MIGRATION_MODULES from your setting.

1reaction
WhiskySodacommented, Jul 23, 2020

I run into this problem frequently, the only way I have found to remedy this is to restore /contrib/sites/migrations/0001_initial.py from the git in order to preserve the migration history

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deleting all migrations and starting over throwing errors #1933
I'm trying to delete all migration files and starting over. ... this error when running makemigrations: django.db.migrations.exceptions.
Read more >
How to Reset Migrations - Simple is Better Than Complex
1. Remove the all migrations files within your project. Go through each of your projects apps migration folder and remove everything inside, ...
Read more >
Django: Safely Remove Old Migrations? - Stack Overflow
Deleting Django migrations is generally a bad idea. Django keeps track of what's in your db through these migration files, as well as...
Read more >
How Do I Reset Django Migration - raturi.in
In this tutorial, you will learn about resetting Django applied migrations and creating fresh migrations. Django's migration can be reset by ...
Read more >
Resetting Entity Framework Migrations to a clean Slate
This post describes the steps on how to remove existing migrations and create a new initial migration from the current schema.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found