#34727: Error in CharField with TextChoices and missing max_length parameter
-------------------------------------+-------------------------------------
     Reporter:  osamahasanone        |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Testing framework    |                  Version:  4.2
     Severity:  Normal               |               Resolution:  invalid
     Keywords:  test, sqlite,        |             Triage Stage:
  CharField, max_length,choices      |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

 Replying to [comment:3 Tim Graham]:
 > Mariusz, did you perhaps remove `max_length` from a model without also
 updating the migration? I don't see how valid SQL could be producd with
 `None` interpolated as a
 
[https://github.com/django/django/blob/addbc90049083f1d5f7ac138ed00111b71a75233/django/db/backends/sqlite3/base.py#L64
 max_length].

 I missed that `makemigrations` didn't generate any migrations for me:
 {{{
 $ python manage.py makemigrations
 SystemCheckError: System check identified some issues:

 ERRORS:
 test_one.DummyModel.dummy_field: (fields.E120) CharFields must define a
 'max_length' attribute.
 }}}

 It seems that they used PostgreSQL to generate a migration and SQLite for
 tests.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34727#comment:4>
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/01070189747c5e14-676d4b58-3b08-438e-b698-8f8e9f0b4377-000000%40eu-central-1.amazonses.com.

Reply via email to