6

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
}
1
  • As the error message suggests it needs to be an array of something. e.g.: Sequelize.ARRAY(Sequelize.TEXT) Also array types are only supported on PostgreSQL. Commented May 25, 2020 at 21:55

1 Answer 1

17

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)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.