1
0
mirror of https://github.com/django/django.git synced 2025-10-30 00:56:09 +00:00

[1.10.x] Fixed #26171 -- Made MySQL create an index on ForeignKeys with db_contraint=False.

Refactored "Prevented unneeded index creation on MySQL-InnoDB" (2ceb10f)
to avoid setting db_index=False.

Backport of 6bf7964023 from master
This commit is contained in:
Aaron Elliot Ross
2016-06-28 14:22:20 +02:00
committed by Tim Graham
parent 5c04852455
commit 198128684b
4 changed files with 21 additions and 11 deletions

View File

@@ -19,6 +19,7 @@ class CurrentTranslation(models.ForeignObject):
class ArticleTranslation(models.Model):
article = models.ForeignKey('indexes.Article', models.CASCADE)
article_no_constraint = models.ForeignKey('indexes.Article', models.CASCADE, db_constraint=False)
language = models.CharField(max_length=10, unique=True)
content = models.TextField()