Closed zenithtekla closed 7 years ago
@zenithtekla You should be able to use tableName
option for model, something like this -
var Assembly = sequelize.define('Assembly ', {
customer_id: {
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false
},
number: DataTypes.STRING(250),
revision: DataTypes.STRING(10)
}, {
timestamps: false,
freezeTableName: true,
tableName: 'orm_assembly_table'
}
}
Hi, On the production floor (my workplace, proj is still pending development), I added new route directly to your app. Here how I tried with Assembly model
If all go like this, I get assemblys displayed correctly.
When I tried with Assembly in place of (au lieu de) _orm_assemblytable, I encountered error of undefined. So, in a router.get(), what should be used as property of models? I tried console.log(models) the models object in models/index.js and saw something like
models: { orm_assembly_table: orm_assembly_table }
Advices? Thanks
P/S: I like to write it models.Assembly than the actual table name (_orm_assemblytable, which is not nice) but I can't get it to work.