Reputation: 617
This is the model that I have
class Tenant(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
name = models.TextField(unique=True)
class Meta:
app_label = "auth"
When I makemigrations in a new venv or run pytest. I always get an error saying
django.db.migrations.exceptions.NodeNotFoundError: Migration nqm_core.0001_initial dependencies reference nonexistent parent node ('auth', '0013_tenant')
I tried the following ways to resolve this issue
None of the above ways worked. The issue got resolved only after I removed the app_label from class Meta for that model. Also I tried removing dependency in the initial migration file but the DB won't migrate at all.
Is this a bug or is there a certain way with which I have to run the migration Currently, I only use the following commands
./manage.py makemigrations
./manage.py migrate
Upvotes: 0
Views: 220
Reputation: 26
Django has default built-in app with name auth, which handles such models like User
, Permission
and others.
The easiest solution for you will be to use another app_label
Upvotes: 0