Opened 64 minutes ago
Last modified 63 minutes ago
#37151 assigned New feature
Add support for squashing across AddIndex, AddConstraint, and AlterConstraint
| Reported by: | Markus Holtermann | Owned by: | Markus Holtermann |
|---|---|---|---|
| Component: | Migrations | Version: | 6.0 |
| Severity: | Normal | Keywords: | migrations |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
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.
Note:
See TracTickets
for help on using tickets.