#25492: warn about migrations mixing schema- and data- changing operations
-----------------------------+--------------------------------------
Reporter: tarkatronic | Owner: nobody
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------------------------
Changes (by shaib):
* version: 1.8 => master
* type: Bug => New feature
Comment:
The problem is that some migrations, even including both schema changes
and data changes, are valid; for an example, see comment:5:ticket:24630.
So, forbidding such migrations is a backwards-incompatible change.
That said, I still think it is a change worth making, at least to some
degree. I think that, for starters, a warning (using the Checks framework)
for mixed operations in a migration could be a good idea. To support it,
we'd need each operation to define its "type" -- schema or data operation,
or "possibly either" (e.g. `RunSQL`); the check would warn if any
migration mixes types, or if a "possibly either" operation is in the same
migration with any other operation. At least for the "possibly either"
operations, the type should be overridable. All these APIs need to be
public, to enable user-defined operations to play nice.
I've modified the ticket title and type in accordance with this
suggestion; if this seems reasonable, we should also change the
description. In any case, a behavior change about this would be a new
feature, and we'd need a reason to backport it even to 1.9, not to mention
1.8.
--
Ticket URL: <https://code.djangoproject.com/ticket/25492#comment:2>
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/069.f4e91951da9afe39eb3c233361656cec%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.