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.
Old description:
> 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.
New description:
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.
Python: 3.5.2, 3.6.1
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#comment:1>
* status: new => closed
* resolution: => invalid
Comment:
I'm sorry. I didn't mention that I was running `makemigrations` with
`--noinput`. [https://docs.djangoproject.com/en/1.11/ref/django-admin
/#cmdoption-makemigrations-noinput It returns exit code `3`, as
documented].
I mentioned this in the ticket:
> Exit code is 0.
It's a mistake.
--
Ticket URL: <https://code.djangoproject.com/ticket/28615#comment:2>