以下脚本执行后未完成。DB 得到了记录,但脚本仍在继续工作。为什么?
var Sequelize = require("sequelize");
var sequelize = new Sequelize('database_name', 'mylogin', 'mypassword', {
host: 'db_host',
port: 5432,
dialect: 'postgres',
protocol: 'postgres',
logging: true,
omitNull: true,
});
var iteration = sequelize.define('iteration', {
id: { type: Sequelize.BIGINT ,
primaryKey: true,
autoIncrement: true,
unique: true},
imported: { type: Sequelize.DATE, defaultValue: Sequelize.NOW },
}, {
tableName: 'iterations'}
);
iteration.create({ imported: Sequelize.NOW}).success(function(iter) {
console.log(iter);
});