#23581: Migration shouldn't generate "DROP DEFAULT" SQL if no database changes
are
required
--------------------------------------+------------------------------------
Reporter: john_scott | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by john_scott):
The rationale for always including all field args/kwargs provided in
ticket:21498#comment:6 was "I'd rather we included every single field -
white/blacklisting fields is dangerous. What if a field subclass redefines
help_text? What if it uses it to help populate ORM objects?" and
ticket:21498#comment:9 "...(we just can't guarantee it's not useful at
database or field runtime)".
Is this really the case though? We *can* determine whether or not any of
the fields provided by Django use `choices` or `help_text` to make
database altering changes. If custom field authors choose to override
these field constructor arguments to result in DDL changes, then it would
understandably also be their responsibility to write a sufficient
deconstruct() method. It's unclear to me why we need the migrations noise
in the common case of using default Django fields.
At any rate, after digging into this deeper I realize there are two
separate and unrelated issues here (excessive `DROP DEFAULT`s and creating
migrations for field constructor arguments that do not modify the db) so
let me know if these should be split into two separate tickets.
--
Ticket URL: <https://code.djangoproject.com/ticket/23581#comment:8>
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.d37dda92214bae9d34da6d5d7393983c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.