1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #27236 -- Deprecated Meta.index_together in favor of Meta.indexes.

This also deprecates AlterIndexTogether migration operation.
This commit is contained in:
David Wobrock
2022-05-17 16:13:35 +02:00
parent 4f284115a9
commit a6385b382e
22 changed files with 178 additions and 14 deletions

View File

@@ -255,7 +255,7 @@ class OperationTestBase(MigrationTestBase):
unique_together=False,
options=False,
db_table=None,
index_together=False,
index_together=False, # RemovedInDjango51Warning.
constraints=None,
indexes=None,
):
@@ -263,6 +263,7 @@ class OperationTestBase(MigrationTestBase):
# Make the "current" state.
model_options = {
"swappable": "TEST_SWAP_MODEL",
# RemovedInDjango51Warning.
"index_together": [["weight", "pink"]] if index_together else [],
"unique_together": [["pink", "weight"]] if unique_together else [],
}