我有一个 kid_ages
列,它是 Integer[]
。迁移时,出现以下错误:
DataTypeNotSupportedError:“postgres”数据库不支持“home.kid_ages”中的数据类型“Array”。
我尝试在我的专栏中添加以下选项:
type: 'array'
和:
array: true,
default: [],
nullable: false,
@Column({
array: true,
default: [],
nullable: false,
})
kid_ages: string;
最佳答案
文档说,它应该可以工作:
@Column("int", { array: true })
array: number[];
在您的代码中,数组属性不是数组。
您尝试过 kid_ages: string[];
吗?
关于javascript - postgres 不支持 TypeORM 数组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57611633/