Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: ARRAY is missing type definition for its values Sequelize

I'm trying to run the command to create the migration on sequelize, on my SQL Server database, and I get the following error:

ERROR: ARRAY is missing type definition for its values

In the js file that was created is the definition:

images: {
   type: Sequelize.ARRAY
}
like image 714
igor g Avatar asked Jan 26 '23 00:01

igor g


1 Answers

After having the same problem myself, I've solved it by changing both model and migration files. They should be like this:

migration file:

images: {
     type: Sequelize.ARRAY(Sequelize.INTEGER)
}

model file:

images: DataTypes.ARRAY(DataTypes.INTEGER)
like image 83
Idan Avatar answered Feb 05 '23 19:02

Idan