While the accepted answer is correct, you can do this once for all tables, and not for this separately for each. You simply pass a similar object to the Sequelize constructor, for example:
var Sequelize = require('sequelize'); //database wide options var opts = { define: { //prevent sequelize from pluralizing table names freezeTableName: true } } var sequelize = new Sequelize('mysql://root:123abc@localhost:3306/mydatabase', opts)
Now, when you define your entities, you do not need to specify freezeTableName: true :
var Project = sequelize.define('Project', { title: Sequelize.STRING, description: Sequelize.TEXT })
d512 Jan 01 '15 at 18:30 2016-01-01 18:30
source share