summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-05-05 09:26:51 +0200
committerGitHub <noreply@github.com>2023-05-05 09:26:51 +0200
commitca5d3c99efb1bcf181e923dcd00c4679ab6174ef (patch)
treedd8fc53100f472f7a814bf91e0e6a706b974cd01 /django
parent024954aad4c422a091b7afab42fff1a9d7478fce (diff)
downloaddjango-ca5d3c99efb1bcf181e923dcd00c4679ab6174ef.tar.gz
Refs #27236 -- Made more cosmetic edits to Meta.index_together deprecation.
Diffstat (limited to 'django')
-rw-r--r--django/db/backends/base/schema.py1
-rw-r--r--django/db/backends/sqlite3/schema.py5
-rw-r--r--django/db/models/options.py3
3 files changed, 5 insertions, 4 deletions
diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py
index 8829de1c03..6b03450e2f 100644
--- a/django/db/backends/base/schema.py
+++ b/django/db/backends/base/schema.py
@@ -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"))
diff --git a/django/db/backends/sqlite3/schema.py b/django/db/backends/sqlite3/schema.py
index 89867b6623..095304c095 100644
--- a/django/db/backends/sqlite3/schema.py
+++ b/django/db/backends/sqlite3/schema.py
@@ -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,
diff --git a/django/db/models/options.py b/django/db/models/options.py
index be3d68f390..00735e0de1 100644
--- a/django/db/models/options.py
+++ b/django/db/models/options.py
@@ -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",