global setting to turn off this feature?
在 2011年12月1日星期四UTC+8下午1时41分12秒,Senthil kumar写道:
Its simple keep the table name plural like
module.exports = function(sequelize, DataTypes) {
return sequelize.define("sample_tables", {
id: DataTypes.INTEGER,
test_name: DataTypes.TEXT
})
--module.exports = function(sequelize, DataTypes) {
return sequelize.define("sample_tables", {
id: DataTypes.INTEGER,
test_name: DataTypes.TEXT
})
On Nov 30, 11:15 pm, Senthil kumar wrote:
I have a problem of having mysql table name with underscore like
(sample_table).
So my sample_table ORM looks like. The below code i have saved it
under models folder with sample_table.js
module.exports = function(sequelize, DataTypes) {
return sequelize.define("sample_table", {
id: DataTypes.INTEGER,
test_name: DataTypes.TEXT
})
}
I have 10 items in the sample_table. When i tried the below code it
doesn't work. And my call was still loading (Like hanging)
var sampleTable = sequelize.import(__dirname + "/models/
sample_table");
sampleTable.findAll().on('success', function(samples) {
console.info('samples.length = ', samples.length);
});
Everything works fine if i create a table in single word like
"Category". But its not working with table having underscore( _ ). Can
anyone help me to fix this issue?
Thanks
Senthil
I have a problem of having mysql table name with underscore like
(sample_table).
So my sample_table ORM looks like. The below code i have saved it
under models folder with sample_table.js
module.exports = function(sequelize, DataTypes) {
return sequelize.define("sample_table", {
id: DataTypes.INTEGER,
test_name: DataTypes.TEXT
})
}
I have 10 items in the sample_table. When i tried the below code it
doesn't work. And my call was still loading (Like hanging)
var sampleTable = sequelize.import(__dirname + "/models/
sample_table");
sampleTable.findAll().on('success', function(samples) {
console.info('samples.length = ', samples.length);
});
Everything works fine if i create a table in single word like
"Category". But its not working with table having underscore( _ ). Can
anyone help me to fix this issue?
Thanks
Senthil
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en