You are seen that error probably because you modified your models after
adding some items to database already. When prompted with the error, enter
2, then ' ' an empty string.

On Sat, 25 Mar 2023, 1:59 p.m. Ebenezer Otchere, <[email protected]>
wrote:

> Am new in django and have been getting errors in migrations, i need help
> when i try to do migrations it keeps telling me this
> it is impossible to add a non-nullable field 'details' to feature 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.
> Thank you  in advance
> from django.db import models
>
> # Create your models here.
>
>
> class feature(models.Model) :
>
>     name = models.CharField(max_length=100)
>     extra = models.CharField(max_length=100)
>     details1 = models.CharField(max_length=500)
>
> class art(models.Model):
>
>     name = models.CharField(max_length=100)
>     details = models.CharField(max_length=500)
>
> --
> 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/06f462e2-3e1d-4a1a-8a97-b183586e5663n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/06f462e2-3e1d-4a1a-8a97-b183586e5663n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAOzVPC858UA6g4J%3D9nL_Ee8jVHqS1t%2BayGryvjTjRuMe91opMw%40mail.gmail.com.

Reply via email to