Cookiecutter-django: Deleting all migrations and starting over throwing errors

Created on 10 Feb 2019  路  4Comments  路  Source: pydanny/cookiecutter-django

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')

Most helpful comment

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.

All 4 comments

@the1plummie

1 - What do you mean by Deleting all migrations?

2 - What is the exact step by step you've done, from the project generation until you get the error?

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.

The answer provided by @foarsitter seems reasonable, I'm closing this as it doesn't look like an issue on our end.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bluesurfer picture bluesurfer  路  4Comments

pygabo picture pygabo  路  3Comments

grll picture grll  路  3Comments

webyneter picture webyneter  路  3Comments

adammsteele picture adammsteele  路  3Comments