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

Fixed #34529, Refs #34525 -- Reduced index operations with Meta.indexes/index_together when optimizing migrations.

This makes squashing migrations an available path for changing
Meta.index_together, which is deprecated, to Meta.indexes.

Follow up to f810325721.
This commit is contained in:
Mariusz Felisiak
2023-05-03 13:06:19 +02:00
committed by GitHub
parent 83339d2103
commit 8e2460d599
5 changed files with 326 additions and 68 deletions

View File

@@ -502,7 +502,8 @@ Should become::
Running the :djadmin:`makemigrations` command will generate a migration
containing a :class:`~django.db.migrations.operations.RenameIndex` operation
which will rename the existing index.
which will rename the existing index. Next, consider squashing migrations to
remove ``index_together`` from historical migrations.
The ``AlterIndexTogether`` migration operation is now officially supported only
for pre-Django 4.2 migration files. For backward compatibility reasons, it's