From 290fd5ecece400490ad6bb557720d3b76f647eaf Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Wed, 3 May 2023 13:06:19 +0200 Subject: [4.2.x] 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 f81032572107846922745b68d5b7191058fdd5f5. Backport of 8e2460d599aec95f8cfe514d3cc8acdd4ca4b1fb from main. --- docs/releases/4.2.1.txt | 5 +++++ docs/releases/4.2.txt | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/releases/4.2.1.txt b/docs/releases/4.2.1.txt index a1130effe8..bed64f6ad1 100644 --- a/docs/releases/4.2.1.txt +++ b/docs/releases/4.2.1.txt @@ -53,3 +53,8 @@ Bugfixes * Fixed a regression in Django 4.2 where breadcrumbs didn't appear on admin site app index views (:ticket:`34512`). + +* Made squashing migrations reduce ``AddIndex``, ``RemoveIndex``, + ``RenameIndex``, and ``CreateModel`` operations which allows removing a + deprecated ``Meta.index_together`` option from historical migrations and use + ``Meta.indexes`` instead (:ticket:`34525`). diff --git a/docs/releases/4.2.txt b/docs/releases/4.2.txt index d923be55b8..7d7848708d 100644 --- a/docs/releases/4.2.txt +++ b/docs/releases/4.2.txt @@ -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 -- cgit v1.3