#28615: makemigrations doesn't generate any output for a model with CharField
blank=False
-------------------------------------+-------------------------------------
Reporter: Mikalai | Owner: nobody
Radchuk |
Type: Bug | Status: new
Component: Database | Version: 1.11
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 |
-------------------------------------+-------------------------------------
It looks `makemigrations` is unable to generate migrations for a model
that contains `CharField` with `blank=False` or with default value (which
is `blank=False`).
I did manage to replicate it on Django 1.9, 1.10, 1.10.8, 1.11, 1.11.4,
1.11.5.
The issue can be reproduced using the following steps:
1. Create an app with `models.py` like this one:
{{{
from django.db import models
class ExternalResourcePage(models.Model):
# authors = models.CharField(max_length=256)
publication_date = models.DateField()
show_on_website = models.BooleanField(default=True)
}}}
2. Run the `makemigrations` command. It will generate an initial migration
file.
3. Uncomment the `authors` field.
4. Run the `makemigrations` command again. It will not generate a new
migration file and will not give you any output. Exit code is `0`.
`makemigrations` works fine with `authors =
models.CharField(max_length=256, blank=True)`
Expected result: `makemigrations` creates a migration file or fails with a
traceback in case of any exceptions.
--
Ticket URL: <https://code.djangoproject.com/ticket/28615>
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/049.cd96cad0752aad02ee6c4c13101051c5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.