[Django] #24529: Allow double squashing of migrations

33 views
Skip to first unread message

Django

unread,
Mar 24, 2015, 7:52:46 AM3/24/15
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
---------------------------------------+------------------------
Reporter: MarkusH | Owner: nobody
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 1 | Needs tests: 1
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------+------------------------
While #23090 added a safeguard to prevent `squashmigrations` from blowing
up when squashing an already squashed migration, this should be possible
in the future to ease transition for 3rd party projects.

It is generally possible to add a squashed migration as a dependency
together with its replaced migrations (e.g. have `0001_initial`,
`0002_second` and `0001_squashed_0002_second` in the dependency list). An
example can be found here: https://github.com/MarkusH/django-ticket-
triage/tree/0aac03c597c744909db60772b99c34c99ed7111d/app_a/migrations

The tasks I identified so far are for now:

1. Remove the safeguard
2. When squashing `0001_0002` and `0003`, the squashed migration
`0001_0003` doesn't consider the already squashed migration operations and
doesn't add them to it's operations list
3. Add squashed migrations to the dependency list

--
Ticket URL: <https://code.djangoproject.com/ticket/24529>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 24, 2015, 9:13:53 AM3/24/15
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-----------------------------+------------------------------------

Reporter: MarkusH | Owner: nobody
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by charettes):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:1>

Django

unread,
Oct 9, 2019, 5:18:59 PM10/9/19
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-----------------------------------+--------------------------------------
Reporter: Markus Holtermann | Owner: Bruno Alla
Type: New feature | Status: assigned
Component: Migrations | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by Bruno Alla):

* owner: nobody => Bruno Alla
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:2>

Django

unread,
Mar 26, 2020, 6:48:12 AM3/26/20
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-----------------------------------+------------------------------------
Reporter: Markus Holtermann | Owner: (none)

Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by Bruno Alla):

* owner: Bruno Alla => (none)
* status: assigned => new


Comment:

Deassigning as I'm no longer actively working on this.

--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:3>

Django

unread,
May 10, 2021, 11:12:20 PM5/10/21
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Raphael
| Gaschignard

Type: New feature | Status: assigned
Component: Migrations | Version: dev

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Raphael Gaschignard):

* cc: Raphael Gaschignard (added)
* owner: (none) => Raphael Gaschignard


* status: new => assigned


Comment:

I have a potential patch for this one that I'm pretty satisfied with, so
self-assigning this one.

--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:4>

Django

unread,
May 11, 2021, 12:56:02 AM5/11/21
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Raphael
| Gaschignard
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Raphael Gaschignard):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/14380 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:5>

Django

unread,
Jul 24, 2021, 10:58:18 PM7/24/21
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Raphael
| Gaschignard
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:6>

Django

unread,
Mar 14, 2022, 9:31:59 AM3/14/22
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Raphael
| Gaschignard
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Raphael Gaschignard):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:7>

Django

unread,
Mar 16, 2022, 11:05:30 AM3/16/22
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Raphael
| Gaschignard
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Raphael Gaschignard):

* needs_docs: 1 => 0
* needs_tests: 1 => 0


Comment:

Unchecked all the "Needs..." to request review on the implementation in
principle.

--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:8>

Django

unread,
Mar 20, 2022, 11:14:07 AM3/20/22
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Raphael
| Gaschignard
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 0 => 1

* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:9>

Django

unread,
Apr 20, 2022, 6:18:02 AM4/20/22
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Raphael
| Gaschignard
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Raphael Gaschignard):

* needs_better_patch: 1 => 0


* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:10>

Django

unread,
May 16, 2022, 3:09:36 AM5/16/22
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Raphael
| Gaschignard
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:11>

Django

unread,
Sep 24, 2024, 7:36:38 AM9/24/24
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Georgi
| Yanchev
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 1 => 0
* owner: Raphael Gaschignard => Georgi Yanchev

Comment:

[https://github.com/django/django/pull/18614 new PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:12>

Django

unread,
Oct 25, 2024, 10:02:36 AM10/25/24
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Georgi
| Yanchev
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:13>

Django

unread,
Nov 15, 2024, 9:46:19 AM11/15/24
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Georgi
| Yanchev
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Georgi Yanchev):

* needs_better_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:14>

Django

unread,
Jan 17, 2025, 7:29:13 AMJan 17
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Georgi
| Yanchev
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:15>

Django

unread,
Jan 17, 2025, 5:22:12 PMJan 17
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Georgi
| Yanchev
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Georgi Yanchev):

* needs_better_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:16>

Django

unread,
Jan 20, 2025, 6:05:10 AMJan 20
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Georgi
| Yanchev
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:17>

Django

unread,
Jan 21, 2025, 4:57:13 AMJan 21
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Georgi
| Yanchev
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:18>

Django

unread,
Jan 22, 2025, 4:56:41 AMJan 22
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Georgi
| Yanchev
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"322785b08cf21f2b7a627caf459e73e6170dd602" 322785b0]:
{{{#!CommitTicketReference repository=""
revision="322785b08cf21f2b7a627caf459e73e6170dd602"
Refs #24529 -- Added replace_migration hook to MigrationLoader.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:19>

Django

unread,
Jan 22, 2025, 4:56:42 AMJan 22
to django-...@googlegroups.com
#24529: Allow double squashing of migrations
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Georgi
| Yanchev
Type: New feature | Status: closed
Component: Migrations | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"64b1ac7292c72d3551b2ad70b2a78c8fe4af3249" 64b1ac7]:
{{{#!CommitTicketReference repository=""
revision="64b1ac7292c72d3551b2ad70b2a78c8fe4af3249"
Fixed #24529 -- Allowed double squashing of migrations.

Co-authored-by: Raphael Gaschignard <rap...@rtpg.co>
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24529#comment:20>
Reply all
Reply to author
Forward
0 new messages