Skip to content
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

New Django Migrations Generated when attempting to upgrade from dj-stripe < 2.4.3 to 2.4.3 #1344

Closed
jjorissen52 opened this issue Apr 23, 2021 · 12 comments
Labels
migrations Anything to do with migrations or upgrading dj-stripe verisons
Milestone

Comments

@jjorissen52
Copy link

Software versions

  • Upgrading from dj-stripe version: < 2.4.3
  • Upgrading to dj-stripe version: 2.4.3
  • Python version: 3.7.10
  • Django version: 3.2
  • Database type and version: PG 11
  • Failing migration id: 0008

Can you reproduce the issue with the latest version of master?
Yes

Describe the issue
In Django 3.2, setting DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" and running makemigrations on an existing project causes a new migration to be made for dj-stripe.

Steps To Reproduce

  • Create an empty Django project
  • install dj-stripe
  • run migrations
  • set DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
  • new migration 0008 is made for dj-stripe
@jjorissen52 jjorissen52 added the migrations Anything to do with migrations or upgrading dj-stripe verisons label Apr 23, 2021
@jleclanche
Copy link
Member

Thanks for the report.

I'm pretty sure that's intended though. What's supposed to happen there? I guess we could be force-specifying this ourselves; wouldn't be a terrible idea.

@jjorissen52
Copy link
Author

I think that if dj-stripe needs to add a 0008 migration in the future, this will cause headache/confusion for those who accidentally run the auto-generated 0008.

@jleclanche
Copy link
Member

Can you post a gist.github.com of what the migration looks like please?

@jjorissen52
Copy link
Author

jjorissen52 commented Apr 23, 2021

@jleclanche jleclanche modified the milestones: 2.4.x, 2.5.0 Apr 23, 2021
@jleclanche
Copy link
Member

Hm, okay, that's less bad than I expected. I think we can just fix those two.

@jjorissen52
Copy link
Author

jjorissen52 commented Apr 23, 2021

I think the rub here is that any one upgrading who uses a non-standard DEFAULT_AUTO_FIELD would have different migrations needed, right? So I don't think you can necessarily just bake the migration in.

@jleclanche
Copy link
Member

No, but we can hard-specify the auto field to be a bigautofield there.

@czue
Copy link
Contributor

czue commented May 7, 2021

Just got bit by this as well. I see this has been moved to the 2.5.0 milestone. is there any clear timeline for that release? Perhaps for 2.4.x you could explicitly set it to AutoField which would at least prevent migrations from being generated?

@jleclanche
Copy link
Member

@czue There's no hard timeline, but if you want to contribute a fix I can review/merge it. A migrationless autofield for 2.4.x is a reasonable solution yeah.

In general right now dj-stripe is starved for development. If you want to help contribute, we could really use the help; we even have a sponsorship program active for regular contributors, see #1221. If you're interested let me know and I can help coach you through the codebase.

@czue
Copy link
Contributor

czue commented May 7, 2021

Hey @jleclanche - I'm interested! I"ll give this change a shot and see how it goes. 🙏

@jleclanche
Copy link
Member

Sweet :) Yeah just CC me on the PR and I'll take a look; if you go the AutoField route I can release a minor version with it.

For further contributions feel free to book some time with me here if you want me to take you through the codebase and what sort of things need to be done :)

@czue
Copy link
Contributor

czue commented May 7, 2021

@jleclanche running into some annoying issues getting set up in case you have any thoughts: #1348

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migrations Anything to do with migrations or upgrading dj-stripe verisons
Projects
None yet
Development

No branches or pull requests

3 participants