#37151: Add support for squashing across AddIndex, AddConstraint, and
AlterConstraint
-----------------------------------+---------------------------------------
Reporter: Markus Holtermann | Type: New feature
Status: new | Component: Migrations
Version: 6.0 | Severity: Normal
Keywords: migrations | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+---------------------------------------
The `AddIndex`, `AddConstraint`, and `AlterConstraint` migration
operations straight out reject squashing across them.
Let's take the following set of operations:
{{{
[
migrations.CreateModel("A", fields=[("id", models.BigAutoField())]),
migrations.AddIndex("b", models.Index(fields=["id"], name="b_idx")),
migrations.AddField("a", "name", models.IntegerField()),
]
}}}
I would expect to get the following 2 operations:
{{{
[
migrations.AddIndex("b", models.Index(fields=["id"], name="b_idx")),
migrations.CreateModel("A", fields=[("id", models.BigAutoField()),
("name", models.IntegerField())]),
]
}}}
Instead, I end up with the same set of operations.
--
Ticket URL: <
https://code.djangoproject.com/ticket/37151>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.