#35508: Add an --ignore-deps flag to squashmigrations
-------------------------------------+-------------------------------------
     Reporter:  Shai Berger          |                    Owner:  Clinton
                                     |  Christian
         Type:  New feature          |                   Status:  assigned
    Component:  Migrations           |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:  squash               |             Triage Stage:  Accepted
  squashmigrations                   |
    Has patch:  1                    |      Needs documentation:  1
  Needs tests:  1                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Shai Berger):

 Replying to [comment:5 Clinton Christian]:
 > Filtering out multi-app `FieldOperation`s is pretty straight forward,
 but should we mutate a `ModelOperation` to exclude multi-app foreign key
 references, or exclude the `ModelOperation` entirely?

 Coming back to this after two years, with the response I put on Clinton's
 [https://github.com/django/django/pull/18276 PR]:

 Many {{{ModelOperation}}}s are, in fact, irrelevant, because they do not
 operate on fields; so it is better to focus at the more-specific operation
 level. and even then, it changes by case. In the case of
 {{{CreateModel}}}, it is better to modify the operation, because it is
 likely that migrations down the line will rely on the model existing --
 even if they don't rely on the relation field. In the case of Index or
 Constraint operations (some of which, by the way, do not inherit
 {{{ModelOperation}}}), it is better to remove the whole operation, because
 the constraint or index will be entirely incorrect if it is missing a
 field.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35508#comment:6>
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 view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019da5e6d037-8e2cd0ea-dbb4-4c99-a316-8f19fdb6ab67-000000%40eu-central-1.amazonses.com.

Reply via email to