Fixed isActual syntax to accept optional model arg
This commit is contained in:
parent
e00b0ba8cf
commit
9d3ab6fc42
13
lib/mysql.js
13
lib/mysql.js
|
@ -693,7 +693,18 @@ MySQL.prototype.createTable = function (model, cb) {
|
||||||
*/
|
*/
|
||||||
MySQL.prototype.isActual = function(models, cb) {
|
MySQL.prototype.isActual = function(models, cb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var ok = false;
|
|
||||||
|
if ((!cb) && ('function' === typeof models)) {
|
||||||
|
cb = models;
|
||||||
|
models = undefined;
|
||||||
|
}
|
||||||
|
// First argument is a model name
|
||||||
|
if ('string' === typeof models) {
|
||||||
|
models = [models];
|
||||||
|
}
|
||||||
|
|
||||||
|
models = models || Object.keys(this._models);
|
||||||
|
|
||||||
async.each(Object.keys(models), function(model, done) {
|
async.each(Object.keys(models), function(model, done) {
|
||||||
var table = self.tableEscaped(model);
|
var table = self.tableEscaped(model);
|
||||||
self.query('SHOW FIELDS FROM ' + table, function(err, fields) {
|
self.query('SHOW FIELDS FROM ' + table, function(err, fields) {
|
||||||
|
|
Loading…
Reference in New Issue