Answer the question
In order to leave comments, you need to log in
How to fix an error when trying to migrate (alter) a database?
Hello.
I'm trying to change one field in the model now, the migration gives me an error that the arguments are not accepted.
It was:
author = models.CharField(max_length=65, help_text="ФИО автора", verbose_name="Имя Автора")
author = models.ForeignKey(Author, on_delete=models.CASCADE, blank=True, null=True)
class Author(models.Model):
author_image = models.ImageField(upload_to='', blank=True, null=True, help_text="Размер изображения 100 * 100",
verbose_name="Фотография автора")
name = models.CharField(max_length=150, help_text="Максимальная длина 150 символов", verbose_name="Имя автора")
description = models.TextField(help_text="Кто такой автор, что делает автор, что он умеет",
verbose_name="Описание автора")
Answer the question
In order to leave comments, you need to log in
Well, create two migrations. One deletes the field, the other creates a new one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question