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

Added no-op AlterField migrations for Django 4.0 #1607

Merged
merged 10 commits into from
Feb 25, 2022

Conversation

arnav13081994
Copy link
Contributor

Description

This PR contains the following changes:

  1. Generated and Added no-op AlterField migrations for m2m and fk fields as mentioned here. This was done because Django 4.0 generates migrations for ManyToManyField and ForeignKey fields.

Checklist:

  • I've updated the tests or confirm that my change doesn't require any updates.
  • I've updated the documentation or confirm that my change doesn't require any updates.
  • I confirm that my change doesn't drop code coverage below the current level.
  • I've updated migrations or confirm that my change doesn't make changes to any model.

Rationale

Fix #1592

@jleclanche
Copy link
Member

If these are noops then you should be able to modify old migrations, not create new ones.

@arnav13081994
Copy link
Contributor Author

@jleclanche My bad.I updated the relevant files.

@@ -1603,15 +1603,15 @@ class Migration(migrations.Migration):
help_text="The latest charge generated for this invoice, if any.",
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="latest_invoice",
related_name="latest_%(class)s",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the first Django version to support this style of related name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.2.0. Also none of the tests failed.

@ayushin
Copy link

ayushin commented Feb 25, 2022

+1

@jleclanche jleclanche merged commit e6d63f5 into dj-stripe:master Feb 25, 2022
@arnav13081994 arnav13081994 deleted the generate_dj_3_10_migrations branch June 16, 2022 05:53
jleclanche pushed a commit that referenced this pull request Jun 28, 2022
* Updated related_name of Invoice.charge to latest_%(class)s

* Updated related_name of Invoice.customer to %(class)ss

* Updated related_name of Invoice.subscription to %(class)ss

* Updated related_name of UpcomingInvoice.subscription to %(class)ss

* Updated related_name of UpcomingInvoice.customer to %(class)ss

* Updated related_name of UpcomingInvoice.charge to latest_%(class)s

* Updated related_name of Invoice.default_tax_rates to +

* Updated related_name of Subscription.default_tax_rates to +

* Updated related_name of SubscriptionItem.tax_rates to +

* Updated related_name of InvoiceItem.tax_rates to +

(cherry picked from commit e6d63f5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

django 4.0.0 missing migrations
3 participants