#27926: Squashmigrations --hard
----------------------------------------+----------------------------------
Reporter: Pascal Briet | Owner: nobody
Type: New feature | Status: new
Component: Migrations | Version: 1.10
Severity: Normal | Keywords: squashmigrations
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------+----------------------------------
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>
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/049.7944462d95aac7ef5f1d428e2dfc7349%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.