#36806: GeneratedField with null=False creates nullable column on MySQL with
spatial types (POINT)
-------------------------------------+-------------------------------------
     Reporter:  Dai-Tado             |                     Type:  Bug
       Status:  new                  |                Component:  Database
                                     |  layer (models, ORM)
      Version:  5.2                  |                 Severity:  Normal
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 **Summary**
 GeneratedField ignores null=False on MySQL - columns are always nullable

 **Description**
 When creating a GeneratedField with null=False on MySQL, the database
 column is always created as nullable, ignoring the null=False parameter.
 Steps to Reproduce

 {{{
 pythonfrom django.db import models

 class MyModel(models.Model):
     area = models.GeneratedField(
         .....
         null=False,  # ← Ignored
     )
 }}}


 - The migration file removes null=False from GeneratedField definition
 - Even if manually added to migration file, Django doesn't apply NOT NULL
 constraint to database
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36806>
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/0107019b27bf681a-fb58d24b-3277-44da-9691-9520fc48cab9-000000%40eu-central-1.amazonses.com.

Reply via email to