please help, something strange happens.
I had a model:
class Feedback(models.Model):
username = models.CharField(
verbose_name=u"Имя",
max_length=100,
blank=True,
)
subject = models.CharField(
verbose_name=u"Тема",
max_length=100,
blank=False,
)
email = models.EmailField(
verbose_name=u"Email",
max_length=100,
blank=True,
)
message = models.TextField(
verbose_name=u'Сообщение',
max_length=50000,
blank=False,
)
date = models.DateTimeField(
verbose_name=u'Дата создания',
default=datetime.now(),
auto_now=True,
)
based on it, I created a feedback form. she worked. I created a few messages, and then delete all entries from the corresponding table in the database
then I changed the names of the fields:
class Feedback(models.Model):
username_f = models.CharField(
verbose_name=u"Имя",
max_length=100,
blank=True,
)
subject_f = models.CharField(
verbose_name=u"Тема",
max_length=100,
blank=False,
)
email_f = models.EmailField(
verbose_name=u"Email",
max_length=100,
blank=True,
)
message_f = models.TextField(
verbose_name=u'Сообщение',
max_length=50000,
blank=False,
)
date_f = models.DateTimeField(
verbose_name=u'Дата создания',
default=datetime.now(),
auto_now=True,
)
and made the following from the console:
(kinopom_env)kalinins@kalinins-Lenovo-Z580 ~/.virtualenvs/kinopom_project/kinopom $ python manage.py schemamigration --auto app_menu
the result was the following:
- Deleted field username on app_menu.Feedback
- Deleted field date on app_menu.Feedback
? The field 'Feedback.message' does not have a default specified, yet is NOT NULL.
? Since you are removing this field, you MUST specify a default
? value to use for existing rows. Would you like to:
? 1. Quit now.
? 2. Specify a one-off value to use for existing columns now
? 3. Disable the backwards migration by raising an exception; you can edit the migration to fix it later
? Please select a choice:
please help to rectify the situation and explain what is happening