Add a patch for fixing broken db_indexes on MySQL on Django 1.8-1.10.

Review Request #11172 — Created Sept. 14, 2020 and submitted

Information

Django Evolution
master

Reviewers

The MySQL backend on Django 1.8 through 1.10 has a heavy-handed
workaround for some of its SQL generation around indexes. It tries to
disable setting indexes on a ForeignKey, leaving that up to MySQL
itself, by setting db_index = False. It claims this is "temporary,"
but it never restores the values. This impacts signatures of these
fields on these versions of Django (and breaks unit tests).

This patch preserves the list of fields that would have their values
reset and then restores db_index on each of them, allowing Django to
continue to avoid those indexes without breaking any future usage of
the flags on these fields.

MySQL unit tests pass on all supported versions of Django.

Summary ID
Add a patch for fixing broken db_indexes on MySQL on Django 1.8-1.10.
The MySQL backend on Django 1.8 through 1.10 has a heavy-handed workaround for some of its SQL generation around indexes. It tries to disable setting indexes on a `ForeignKey`, leaving that up to MySQL itself, by setting `db_index = False`. It claims this is "temporary," but it never restores the values. This impacts signatures of these fields on these versions of Django (and breaks unit tests). This patch preserves the list of fields that would have their values reset and then restores `db_index` on each of them, allowing Django to continue to avoid those indexes without breaking any future usage of the flags on these fields.
97c826c943ed019fdce067dcf0e7aaf72fa38b99
Description From Last Updated

E999 SyntaxError: invalid syntax

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (a7d5474)