On Friday 05 May 2017 20:08:01 Er. Rv Ranga wrote:
> python manage.py makemigrations blog
>
> You are trying to add a non-nullable field 'body' to post without a
> default; we can't do that (the database needs something to populate
> existing rows).
> Please select a fix:
> 1) Provide a one-off
Hello,
I know somewhat about this situation.
I was a beginner some months ago :-)
the situation is :
you change something in a model (add a non-nullable field)
when you send « makemigrations" the ORM needs to get a value for the new fields
just because it’s non-nullable
before modifying anythi
You are adding a non-null field to a table, so the existing rows from
that table need a value to put in it to enforce the non-null rule.
If you select 1, you type that value, and it is used for all
previously existing rows in the table.
On 5/6/17, Er. Rv Ranga wrote:
> python manage.py makemigr
python manage.py makemigrations blog
You are trying to add a non-nullable field 'body' to post without a
default; we can't do that (the database needs something to populate
existing rows).
Please select a fix:
1) Provide a one-off default now (will be set on all existing rows with a
null valu
4 matches
Mail list logo