【发布时间】:2013-09-15 13:58:34
【问题描述】:
如何在 Sequelize 迁移脚本中向表中添加数据? 这是我得到的:
module.exports = {
up: function(migration, DataTypes, done) {
migration.createTable(
'person',
{
name: DataTypes.STRING,
age: DataTypes.INTEGER
},
{
charset: 'latin1' // default: null
}
);
// I want to insert person and age.
migration.insert(???);
done()
},
down: function(migration, DataTypes, done) {
migration.dropTable('queue');
done()
}
}
【问题讨论】:
标签: node.js sequelize.js