diff --git a/lib/mysql.js b/lib/mysql.js index 0864a2e..17cbabe 100644 --- a/lib/mysql.js +++ b/lib/mysql.js @@ -690,10 +690,21 @@ MySQL.prototype.createTable = function (model, cb) { * @param {String[]} [models] A model name or an array of model names. If not present, apply to all models * @param {Function} [cb] The callback function */ -MySQL.prototype.isActual = function(cb) { +MySQL.prototype.isActual = function(models, cb) { var self = this; - var ok = false; - async.each(Object.keys(this._models), function(model, done) { + + 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) { var table = self.tableEscaped(model); self.query('SHOW FIELDS FROM ' + table, function(err, fields) { self.query('SHOW INDEXES FROM ' + table, function(err, indexes) {