I want to create only one row using insert()migration in Sequelize. I have seen examples for bulkInsert(), but do not want to use volume. We have this function to create only one line:
insert(instance, tableName, values, options)
But I don’t understand what is the instance here in param? I use bulkInsertbecause it does not request, for example, param. It will be great if you can add an insert to my code written below. Migration library: https://github.com/sequelize/sequelize/blob/master/lib/query-interface.js
module.exports = {
up: queryInterface => {
queryInterface.describeTable("Platforms").then(attributes => {
return queryInterface.bulkInsert("Platforms", [
{
id: 6,
display_name: "Booking.com",
code: "booking.com"
}
]);
});
},
down: queryInterface => {
return queryInterface.bulkDelete("Platforms", {
id: 6
});
}
};
source
share