Merge pull request #39 from JohnnyBill/patch-1

cannot read property of undefined fixed
This commit is contained in:
Raymond Feng 2014-06-16 08:31:26 -07:00
commit 54b874a983
1 changed files with 1 additions and 1 deletions

View File

@ -635,7 +635,7 @@ MySQL.prototype.autoupdate = function (models, cb) {
wait++;
self.query('SHOW FIELDS FROM ' + self.tableEscaped(model), function (err, fields) {
self.query('SHOW INDEXES FROM ' + self.tableEscaped(model), function (err, indexes) {
if (!err && fields.length) {
if (!err && fields && fields.length) {
self.alterTable(model, fields, indexes, done);
} else {
self.createTable(model, done);