I have made some changes to my model, changed a CharField to ArrayField. I am using Django 2 and PostgreSQL 11. Now I am getting an error while running migrate command: django.db.utils.ProgrammingError: cannot cast type jsonb to character varying[] LINE 1: ...MN "msg_list" TYPE varchar(500)[] USING "msg_list"::varchar(...

I have googled the topic but I didn't find any solution to the issue.

Here is the code for my model:


class Sentence(models.Model):
    sent = models.CharField(max_length=150)
    msg_list = ArrayField(models.CharField(max_length=500), blank=True, null=True)
    sent_correct = models.CharField(max_length=300, blank=True)
    pub_date = models.DateTimeField(default=timezone.now)

0 Answers