From 0b04d461e4a1a6630aff442d21a75b03dbc40a61 Mon Sep 17 00:00:00 2001 From: Matthew Dickinson Date: Mon, 17 Oct 2016 16:51:30 -0400 Subject: [PATCH] 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 --- lib/migration.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/migration.js b/lib/migration.js index 5c10a3f..9bd05a5 100644 --- a/lib/migration.js +++ b/lib/migration.js @@ -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) {