-
-
Notifications
You must be signed in to change notification settings - Fork 622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FAQ/Documentation on Migration Pitfalls Should Be Added #849
Comments
When you're generating mgirations, a migration ends up being put inside the This is because in your meta you have:
the I cannot insist enough that a migration getting generated into the site packages is a sign of a serious issue, either in In your case, I believe removing |
Thanks for the reply. The solution about removing Since the problem has been discovered during local mock testing, I can still squish those migrations prior to any production/testing environment deployment. Thanks for the help <3 |
Alright, we should add something to the FAQ about this (and for other things). subclassing models can easily mess things up if you're not careful |
Hi there,
If the problem has been answered please also let me know, since I am not sure the correct keyword for this question.
django-taggit version:3.1.0
Django version: 4.1.5
Assuming I have a Django app named
news
, the models.py file of this app contains code below:When I execute the command
python manage.py makemigrations
, it generates 2 migrations:The model generated within
taggit
is located within the Python environment, which is not included within the Git directory of my project. The migration file generated for thenews
app relies on the tag:The problem comes when I deploy the code using git and Docker, when running
python manage.py migrate
within a freshly created container, it shows the error:django.db.migrations.exceptions.NodeNotFoundError: Migration news.0001_initial dependencies reference nonexistent parent node ('taggit', '0006_newstag')
Is there any solutions that I can solve the problem? My current solution is to create the base migration at the beginning, leave the tag not created at the first place, and let the container run
python manage.py makemigrations
andpython manage.py migrate
when starts up. Yet this causes wider problem about migration inconsistency.The text was updated successfully, but these errors were encountered: