So i was trying to deploy a django app to heroku which works fine locally.
Though the deployment process completes successfully but the migrate command gives an error.
django.db.migrations.exceptions.NodeNotFoundError: Migration accounts.0001_initial dependencies reference nonexistent parent node ('auth', '0013_alter_user_email')
Here is my migration file;
import accounts.models
from django.conf import settings
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
from django.contrib.postgres.operations import CreateExtension
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('auth', '0013_alter_user_email'),
]
operations = [...]
From discussion in the comments it seems that the migration 0013_alter_user_email
does not actually exist in the auth
app. It is generated because I modify the user model by accessing it during runtime using User._meta.get_field('email').unique
to make the email field unique.