我用actionhero
+sequelize
加mysql。当我这样做时
var sequelize = new Sequelize("MJN", "testUser", "testPasss", {
"host": "192.168.123.321",
"dialect": "mysql",
"port": 3306,
"pool": {
"maxConnections": 20,
"maxIdleTime": 30000
}
});
var MJNCustomer = sequelize.import(__dirname + "/../models/MJNCustomer.js");
我这样做console.log(MJNCustomer.tableName);
了,它返回MJNCustomers
而不是MJNCustomer
.
这是models/MJNCustomer.js
module.exports = function(sequelize, DataTypes) {
return sequelize.define('MJNCustomer', {
customerId: DataTypes.STRING,
fname: DataTypes.STRING,
lname: DataTypes.STRING,
address1: DataTypes.STRING,
address2: DataTypes.STRING,
city: DataTypes.STRING,
phoneNumber: DataTypes.STRING
});
}
我在这里做错了什么?