-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Added no-op AlterField migrations for Django 4.0 #1607
Conversation
If these are noops then you should be able to modify old migrations, not create new ones. |
9ea888d
to
029400b
Compare
@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", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
+1 |
* 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)
Description
This PR contains the following changes:
no-op AlterField
migrations form2m
andfk
fields as mentioned here. This was done because Django 4.0 generates migrations for ManyToManyField and ForeignKey fields.Checklist:
tests
or confirm that my change doesn't require any updates.documentation
or confirm that my change doesn't require any updates.migrations
or confirm that my change doesn't make changes to any model.Rationale
Fix #1592