-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Fixed #32132 -- Fixed column types in m2m intermediary tables for Positive(Big/Small)IntegerFields. #13592
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
Conversation
Yes please for tests. Maybe here? https://www.github.com/django/django/tree/master/tests%2Fmodel_fields%2Ftest_integerfield.py |
ddacfaf
to
e57ff6a
Compare
Hi @charettes and @smithdc1 |
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.
Thanks for the tests @David-Wobrock.
I think we should base tests expected values of connection.features.related_fields_match_type
instead of the raw DDL otherwise it will be hard for custom backends running the Django test suite to opt-in into these tests.
e57ff6a
to
9ad0eaa
Compare
46848db
to
e4bb09f
Compare
I adapted the tests, but still didn't switch on |
@David-Wobrock Thanks 👍 I pushed small edits and moved extra tests to a separate commit. |
Ticket: https://code.djangoproject.com/ticket/32132
Hello 👋
I basically added a type switching when getting the related field type for the PositiveBigIntegerField and PositiveSmallIntegerField, as they are defined/used by the BigIntegerField and SmallIntegerField, instead of hard-coding the IntegerField :)
I'm not 100% of the side-effects linked to inheriting from BigIntegerField and SmallIntegerField. But I would expect it to be rather limited and in the end more beneficial than harmful.
The PR is also missing unit tests. Please let me know if I should add some (and if yes, where those are located, I had trouble finding this logic in the tests)