Django can't add a new field by itself without null values being allowed 
here, especially when you have unique=True set on this field. To solve that 
issue, you have to perform it in steps:

   1. Add a column with null=True or without unique=True and with some 
   default value
   2. Make sure that all records in database will have a unique value.
   3. Change the field to the final state.


On Friday, September 16, 2022 at 3:38:56 AM UTC+8 [email protected] wrote:

> Hello I am new in Django users group. I am using Django and faching a 
> problem when i do any changes in existing models after run  makemigrations.
>
>
> This is problem :-It is impossible to add a non-nullable field 'logo' to 
> jobdetails without specifying a default. This is because 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 value for this column)
>  2) Quit and manually define a default value in models.py.
> Select an option: 2
>
>
> please help how can i solve this problem .
>
> Thank you 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users/9d93089a-c6ee-47a2-a925-93bb51a836fbn%40googlegroups.com.

Reply via email to