#32832: Adding nullable TextField/JSONField with default fails on MySQL 8.0.13+.
-------------------------------------+-------------------------------------
     Reporter:  Omkar Deshpande      |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Migrations           |                  Version:  3.2
     Severity:  Release blocker      |               Resolution:
     Keywords:  django, mysql,       |             Triage Stage:
  textfield, JsonField               |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

 * cc: Simon Charette, Jordan Bae (added)
 * severity:  Normal => Release blocker


Comment:

 Regression in d4ac23bee1c84d8e4610350202ac068fc90f38c0.
 Reproduced at fcd44b889f36c4be87910745614a0a4c88d7a3d8.

 We can consider backporting 5e04e84d67da8163f365e9f5fcd169e2630e2873 and
 fix it with:
 {{{
 diff --git a/django/db/backends/base/schema.py
 b/django/db/backends/base/schema.py
 index c409464eca..77c5ce1629 100644
 --- a/django/db/backends/base/schema.py
 +++ b/django/db/backends/base/schema.py
 @@ -900,7 +900,7 @@ class BaseDatabaseSchemaEditor:

          new_db_params =
 new_field.db_parameters(connection=self.connection)
          if drop:
 -            if new_field.null:
 +            if new_field.null and not
 self.skip_default_on_alter(new_field):
                  sql = self.sql_alter_column_no_default_null
              else:
                  sql = self.sql_alter_column_no_default
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32832#comment:1>
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 on the web visit 
https://groups.google.com/d/msgid/django-updates/067.353295102e1603a9d549ffb80cb3fa1c%40djangoproject.com.

Reply via email to