Database postgres如何存储django choice“字段-获取列”;“类型”;关系不存在错误

Database postgres如何存储django choice“字段-获取列”;“类型”;关系不存在错误,database,django,postgresql,django-models,choicefield,Database,Django,Postgresql,Django Models,Choicefield,我有一个CharField类型和一个选项字段,如下所示: class Thing(models.Model): def __unicode__(self): return self.name A = 'a' B = 'b' C = 'c' TYPE_CHOICES = ( (A, 'a'), (B, 'b'), (C, 'c'), ) ... type =

我有一个CharField类型和一个选项字段,如下所示:

class Thing(models.Model):
    def __unicode__(self):
        return self.name

    A = 'a'
    B = 'b'
    C = 'c'

    TYPE_CHOICES = (
        (A, 'a'),
        (B, 'b'),
        (C, 'c'),
    )
        ...
    type = models.CharField(max_length = 1, choices=TYPE_CHOICES)
        ...
现在,当我尝试访问页面add/thing时,我在/path/to/thing/add处遇到一个数据库错误/ 关系“place\u thing”的“type”列不存在

我检查了数据库(postgres),发现类型不是错误中所说的列

为什么在同步或迁移数据库时未添加类型字段

如何在我的数据库(postgres)中创建“TYPE_CHOICES”和“TYPE”列

有人能给我解释一下数据库会为类创建什么吗

多谢各位

凯蒂

我最终使用了

改变表格名称添加列类型varchar(30)

这起作用了

我猜类型选择栏已经制作好了

谢谢

请注意,列名的“类型”可能不是一个好的选择。