#26867: Migrate very slow
-------------------------------------+-------------------------------------
Reporter: hugotacito | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Migrations | Version: 1.9
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by hugotacito):
Hello MarkusH, the problem is that my code is used by different companies
with different databases, so I think it's hard to manage squashed
migrations between all the companies. Although I solved my problem with
this diff:
{{{
diff --git a/django/db/migrations/executor.py
b/django/db/migrations/executor.py
index fb9c7a9..25170c3 100644
--- a/django/db/migrations/executor.py
+++ b/django/db/migrations/executor.py
@@ -135,6 +135,8 @@ class MigrationExecutor(object):
# Only mutate the state if the migration is actually
applied
# to make sure the resulting state doesn't include
changes
# from unrelated migrations.
+ if 'apps' in state.__dict__:
+ delattr(state, 'apps') # Remove the render all
migration.mutate_state(state, preserve=False)
applied_migrations.remove(migration)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26867#comment:5>
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/068.448cf57ab730703e86a09e8af4960740%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.