How can I add data to a table in a Sequelize migration script? This is what I got:
module.exports = {
up: function(migration, DataTypes, done) {
migration.cr
I figured it out. Sequelize is available from migration.migrator.sequelize. It is possible to do something like this:
up: function (migration, DataTypes, done) {
migration.createTable(
'Person',
{
name: DataTypes.STRING,
age: DataTypes.INTEGER,
}
).success(function () {
migration.migrator.sequelize.query("insert into person (name, age) values ('Donald Duck', 60)");
done();
});
},
down: function (migration, DataTypes, done) {
migration.dropTable(
'Person'
).then(function() {
done();
})
}