gpt4 book ai didi

node.js - Sequelize PostgreSQL : Change Column type string to array of String

转载 作者:行者123 更新时间:2023-11-29 13:17:03 27 4
gpt4 key购买 nike

我正在将 Sequelize ORM 与 PostgreSQL 结合使用。

我需要将列的类型从 String 更改为 Array[String]。

我使用了这个迁移脚本

向上:(queryInterface,Sequelize)=> {
返回 queryInterface.changeColumn('email','to', {
类型:Sequelize.ARRAY(Sequelize.TEXT),
允许为空:假
});
}

ERROR: column "to" cannot be cast automatically to type text[]

我尝试了来自 this 的答案 链接,但它对我不起作用

如果我做错了什么,请告诉我。

最佳答案

它是 issue with pg@7.0.2

降级到 pg@6.4.1 解决了这个问题。

关于node.js - Sequelize PostgreSQL : Change Column type string to array of String,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47688848/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com