mirror of https://github.com/django/django.git
Refs #27236 -- Made more cosmetic edits to Meta.index_together deprecation.
This commit is contained in:
parent
024954aad4
commit
ca5d3c99ef
|
@ -1496,6 +1496,7 @@ class BaseDatabaseSchemaEditor:
|
|||
for field in model._meta.local_fields:
|
||||
output.extend(self._field_indexes_sql(model, field))
|
||||
|
||||
# RemovedInDjango51Warning.
|
||||
for field_names in model._meta.index_together:
|
||||
fields = [model._meta.get_field(field) for field in field_names]
|
||||
output.append(self._create_index_sql(model, fields=fields, suffix="_idx"))
|
||||
|
|
|
@ -272,6 +272,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
|
|||
for unique in model._meta.unique_together
|
||||
]
|
||||
|
||||
# RemovedInDjango51Warning.
|
||||
# Work out the new value for index_together, taking renames into
|
||||
# account
|
||||
index_together = [
|
||||
|
@ -301,7 +302,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
|
|||
"app_label": model._meta.app_label,
|
||||
"db_table": model._meta.db_table,
|
||||
"unique_together": unique_together,
|
||||
"index_together": index_together,
|
||||
"index_together": index_together, # RemovedInDjango51Warning.
|
||||
"indexes": indexes,
|
||||
"constraints": constraints,
|
||||
"apps": apps,
|
||||
|
@ -317,7 +318,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
|
|||
"app_label": model._meta.app_label,
|
||||
"db_table": "new__%s" % strip_quotes(model._meta.db_table),
|
||||
"unique_together": unique_together,
|
||||
"index_together": index_together,
|
||||
"index_together": index_together, # RemovedInDjango51Warning.
|
||||
"indexes": indexes,
|
||||
"constraints": constraints,
|
||||
"apps": apps,
|
||||
|
|
|
@ -43,8 +43,7 @@ DEFAULT_NAMES = (
|
|||
"proxy",
|
||||
"swappable",
|
||||
"auto_created",
|
||||
# Must be kept for backward compatibility with old migrations.
|
||||
"index_together",
|
||||
"index_together", # RemovedInDjango51Warning.
|
||||
"apps",
|
||||
"default_permissions",
|
||||
"select_on_save",
|
||||
|
|
Loading…
Reference in New Issue