Skip to content

Commit b647dd7

Browse files
committed
Extract isActual function
1 parent ab584dc commit b647dd7

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

lib/migration.js

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -51,41 +51,6 @@ function mixinMigration(PostgreSQL) {
5151
});
5252
};
5353

54-
/*!
55-
* Check if the models exist
56-
* @param {String[]} [models] A model name or an array of model names. If not present, apply to all models
57-
* @param {Function} [cb] The callback function
58-
*/
59-
PostgreSQL.prototype.isActual = function(models, cb) {
60-
var self = this;
61-
62-
if ((!cb) && ('function' === typeof models)) {
63-
cb = models;
64-
models = undefined;
65-
}
66-
// First argument is a model name
67-
if ('string' === typeof models) {
68-
models = [models];
69-
}
70-
71-
models = models || Object.keys(this._models);
72-
73-
var changes = [];
74-
async.each(models, function(model, done) {
75-
self.getTableStatus(model, function(err, fields) {
76-
changes = changes.concat(self.getAddModifyColumns(model, fields));
77-
changes = changes.concat(self.getDropColumns(model, fields));
78-
done(err);
79-
});
80-
}, function done(err) {
81-
if (err) {
82-
return cb && cb(err);
83-
}
84-
var actual = (changes.length === 0);
85-
cb && cb(null, actual);
86-
});
87-
};
88-
8954
/*!
9055
* Alter the table for the given model
9156
* @param {String} model The model name

0 commit comments

Comments
 (0)