dj-stripe creates a strange migration which is not present in 2.6.1 release package or source repo
See original GitHub issueDescribe the bug
I created a django model where I have a OneToOneField to djstripe’s Customer. When I run makemigrations
a migration is created with the following dependency:
dependencies = [ ('djstripe', '0011_alter_invoice_charge_alter_invoice_customer_and_more'), ('users', '0007_rename_username), ]
Everything seems to be okay locally, but then when I deploy my code it fails with the following error:
django.db.migrations.exceptions.NodeNotFoundError: Migration users.0008_stripecustomer dependencies reference nonexistent parent node ('djstripe', '0011_alter_invoice_charge_alter_invoice_customer_and_more')
Our pipeline does not run makemigrations
, only migrate
, so this seems a little weird that a djstripe migration is created when I run makemigrations
locally but then I cannot use it in deployment. Plus, such migration does not exist in djstripe GitHub repository. It’s strange that there are changes in Invoice model that are not reflected in migrations.
Software versions
- dj-stripe version: 2.6.1
- Python version: 3.9
- Django version: 4.0.1
- Stripe API version: 2.68.0
- Database type and version: postgres 12.9
Steps To Reproduce
- Install dj-stripe: poetry add dj-stripe
- Add djstripe to INSTALLED_APPS
- Run manage makemigrations
- Run manage migrate
- Deploy to AWS
Can you reproduce the issue with the latest version of master? No. Apparently this migration is not created with the latest version of master (2.7.0-alpha.7 ee6b614)
Expected Behavior
All migrations are applied correctly in deployment.
Actual Behavior
django.db.migrations.exceptions.NodeNotFoundError: Migration users.0008_stripecustomer dependencies reference nonexistent parent node ('djstripe', '0011_alter_invoice_charge_alter_invoice_customer_and_more')
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:8 (3 by maintainers)
Top GitHub Comments
Awesome, thank you! I will try that. I actually just found a temporary fix that brought my Heroku Django project back online. It was to copy the djstripe app from the site_packages directory into my Django project so I can push the correct migrations to Heroku.
dj-stripe 2.6.2 has been released, containing this fix.