#30642: Unable to include default value in column_sql
-------------------------------------+-------------------------------------
Reporter: jcohen28 | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 2.2
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The column_sql accepts an include_default argument, which is defaulted to
False if it is not passed.
https://github.com/django/django/blob/master/django/db/backends/base/schema.py#L202
The code that calls it in table_sql, however, doesn't pass the argument so
always defaults to False.
https://github.com/django/django/blob/master/django/db/backends/base/schema.py#L155
As a result, it does not appear possible to turn on that flag for
migrations.
I have got this functionality working by subclassing the
DatabaseSchemaEditor and overriding the `column_sql` function to default
`include_default=True`.
--
Ticket URL: <https://code.djangoproject.com/ticket/30642>
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/051.a3aa85f7ebf7e380bb7bc8169f571fc0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.