Home Sequelize PostgreSQL: Change Column type string to array of String
Reply: 1

Sequelize PostgreSQL: Change Column type string to array of String

Vishnu Mishra
1#
Vishnu Mishra Published in 2017-12-07 06:23:09Z

I'm using the Sequelize ORM with PostgreSQL.

I need to Change the type of a column from String to Array[String].

I used this migration Script

up: (queryInterface, Sequelize) => { return queryInterface.changeColumn('email','to', { type:Sequelize.ARRAY(Sequelize.TEXT), allowNull: false }); }

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

I tried the answer from this link but It does not work for me

Please let me know If I'm doing something wrong.

Vishnu Mishra
2#
Vishnu Mishra Reply to 2017-12-07 06:59:40Z

It was issue with pg@7.0.2

Downgrading to pg@6.4.1 fixes the issue.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.310275 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO