I want to create new model with name query but due to this issue I can't do that. this customer model had been created and working properly
from django.db import models
class Customer(models.Model):
fullname=models.CharField(blank=False,max_length=100)
username=models.CharField(blank=False,max_length=100)
email=models.CharField(blank=False,max_length=100)
password=models.CharField(blank=False,max_length=100)
cpassword=models.CharField(blank=False,max_length=100)
phone=models.CharField(blank=False,max_length=100)
address=models.CharField(blank=False,max_length=256)
city=models.CharField(blank=False,max_length=256)
def register(self):
self.save()
I want to create new model but due to this issue I can't do that. this customer model had been created for few days before. its properly working but new model can't create. I tried to create same model in new project, just by copy and paste so the new model had been created but the same model is not working in this project. this error occurred in terminal.
python manage.py makemigrations It is impossible to change a nullable field 'email' on customer to non-nullable without providing 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) Ignore for now. Existing rows that contain NULL values will have to be handled manually, for example with a RunPython or RunSQL operation. 3) Quit and manually define a default value in models.py.