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:
|
for field in model._meta.local_fields:
|
||||||
output.extend(self._field_indexes_sql(model, field))
|
output.extend(self._field_indexes_sql(model, field))
|
||||||
|
|
||||||
|
# RemovedInDjango51Warning.
|
||||||
for field_names in model._meta.index_together:
|
for field_names in model._meta.index_together:
|
||||||
fields = [model._meta.get_field(field) for field in field_names]
|
fields = [model._meta.get_field(field) for field in field_names]
|
||||||
output.append(self._create_index_sql(model, fields=fields, suffix="_idx"))
|
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
|
for unique in model._meta.unique_together
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# RemovedInDjango51Warning.
|
||||||
# Work out the new value for index_together, taking renames into
|
# Work out the new value for index_together, taking renames into
|
||||||
# account
|
# account
|
||||||
index_together = [
|
index_together = [
|
||||||
|
@ -301,7 +302,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
|
||||||
"app_label": model._meta.app_label,
|
"app_label": model._meta.app_label,
|
||||||
"db_table": model._meta.db_table,
|
"db_table": model._meta.db_table,
|
||||||
"unique_together": unique_together,
|
"unique_together": unique_together,
|
||||||
"index_together": index_together,
|
"index_together": index_together, # RemovedInDjango51Warning.
|
||||||
"indexes": indexes,
|
"indexes": indexes,
|
||||||
"constraints": constraints,
|
"constraints": constraints,
|
||||||
"apps": apps,
|
"apps": apps,
|
||||||
|
@ -317,7 +318,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
|
||||||
"app_label": model._meta.app_label,
|
"app_label": model._meta.app_label,
|
||||||
"db_table": "new__%s" % strip_quotes(model._meta.db_table),
|
"db_table": "new__%s" % strip_quotes(model._meta.db_table),
|
||||||
"unique_together": unique_together,
|
"unique_together": unique_together,
|
||||||
"index_together": index_together,
|
"index_together": index_together, # RemovedInDjango51Warning.
|
||||||
"indexes": indexes,
|
"indexes": indexes,
|
||||||
"constraints": constraints,
|
"constraints": constraints,
|
||||||
"apps": apps,
|
"apps": apps,
|
||||||
|
|
|
@ -43,8 +43,7 @@ DEFAULT_NAMES = (
|
||||||
"proxy",
|
"proxy",
|
||||||
"swappable",
|
"swappable",
|
||||||
"auto_created",
|
"auto_created",
|
||||||
# Must be kept for backward compatibility with old migrations.
|
"index_together", # RemovedInDjango51Warning.
|
||||||
"index_together",
|
|
||||||
"apps",
|
"apps",
|
||||||
"default_permissions",
|
"default_permissions",
|
||||||
"select_on_save",
|
"select_on_save",
|
||||||
|
|
Loading…
Reference in New Issue