Update signature for alterTable

Since alterTable is semi-public, the method now checks the arugments to
make sure that it still supports the old signature that doesn't include
actualFks
This commit is contained in:
Matthew Dickinson 2016-10-17 16:51:30 -04:00
parent d461d07f34
commit 0b04d461e4
1 changed files with 6 additions and 0 deletions

View File

@ -116,6 +116,12 @@ function mixinMigration(MySQL, mysql) {
};
MySQL.prototype.alterTable = function(model, actualFields, actualIndexes, actualFks, done, checkOnly) {
//if this is using an old signature, then grab the correct callback and check boolean
if ('function' == typeof actualFks && typeof done !== 'function') {
checkOnly = done || false;
done = actualFks;
}
var self = this;
var m = this.getModelDefinition(model);
var propNames = Object.keys(m.properties).filter(function(name) {