1
0
mirror of https://github.com/django/django.git synced 2025-10-27 23:56:08 +00:00

Fixed #27859 -- Ignored db_index for TextField/BinaryField on Oracle and MySQL.

Thanks Zubair Alam for the initial patch and Tim Graham for the review.
This commit is contained in:
Mariusz Felisiak
2017-05-23 17:02:40 +02:00
committed by GitHub
parent b3eb6eaf1a
commit 538bf43458
13 changed files with 114 additions and 19 deletions

View File

@@ -119,3 +119,10 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
def prepare_default(self, value):
return self.quote_value(value)
def _field_should_be_indexed(self, model, field):
create_index = super()._field_should_be_indexed(model, field)
db_type = field.db_type(self.connection)
if db_type is not None and db_type.lower() in self.connection._limited_data_types:
return False
return create_index