#27926: Squashmigrations --hard
----------------------------------+--------------------------------------
     Reporter:  Pascal Briet      |                    Owner:  nobody
         Type:  New feature       |                   Status:  new
    Component:  Migrations        |                  Version:  1.10
     Severity:  Normal            |               Resolution:
     Keywords:  squashmigrations  |             Triage Stage:  Unreviewed
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+--------------------------------------
Description changed by Pascal Briet:

Old description:

> Here is a suggestion : instead of trying to merge together migrations,
> start from the models.
> It would be a sort of equivalent of applying ./manage.py makemigrations
> on a project with no migrations.
>
> I reproduced this in a script, and it's working like a charm :
> - List all the migrations for every app
> - Remove the migration files
> - Run makemigrations
> - Put a "replaces = []" statement in each one
> - Rename them to avoid conflicts.
>
> See script attached. It is surely not the way you would implement it
> directly in Django, but it might help.
>
> The idea behind it is : not struggling anymore with squashmigrations. Get
> something clean, and forget about the past.

New description:

 Here is a suggestion : instead of trying to merge together migrations,
 start from the models.
 It would be a sort of equivalent of applying ./manage.py makemigrations on
 a project with no migrations.

 I reproduced this in a script, and it's working like a charm :
 - List all the migrations for every app
 - Remove the migration files
 - Run makemigrations
 - Put a "replaces = [(...)]" statement in each one
 - Rename them to avoid conflicts.

 See script attached. It is surely not the way you would implement it
 directly in Django, but it might help.

 The idea behind it is : not struggling anymore with squashmigrations. Get
 something clean, and forget about the past.

--

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.58dafd317c44e45745aa3398cfc6102d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to