在 python 如何从更新的 peewee 模式更新 psql Table 列

In python how to update psql Table column from updated peewee schema

我在 psql 数据库中有一个表 属性:

author_ids = ArrayField(null=False)

我想用以下 属性 更新此 table 的专栏:

author_ids = ArrayField(IntegerField, null=False, index=True)

我正在使用 Peewee 的迁移,但无法更新列。

你说得对,Schema Migrations for modifying a column's type. But from ArrayField里面没有API,我说默认的已经是IntegerField了,所以这里不用改。

这使得 index = True 成为唯一的变化,add_index 涵盖了它。