Soy nuevo en el desarrollo de NodeJs. Estoy usando NodeJs con mysql y Sequelize para crear un modelo por lotes con estas propiedades.
const Batch = sequelize.define( "Batch", { title: { type: DataTypes.STRING, allowNull: false }, studentIds: { type: DataTypes.STRING }, teacherId: { type: DataTypes.STRING, allowNull: true } }, { timestamps: false } );En la llamada al método asíncrono, funciona bien.
Batch.sync().then((res) => { console.log("Batch model sync : ", Batch === sequelize.models.Batch); });Pero necesito cambiar
studentIds: { type: DataTypes.ARRAY(DataTypes.STRING)}Siempre que hago este cambio me da error
Estoy usando el nodo 14.5.0 MySql 8.0.21 y Sequelize 6.3.4
DataTypes.ARRAY no está disponible en Mysql , solo está disponible en postgres .
Consulte los documentos oficiales: https://sequelize.org/master/class/lib/data-types.js~ARRAY.html