Merge pull request #39 from JohnnyBill/patch-1
cannot read property of undefined fixed
This commit is contained in:
commit
54b874a983
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue