From a15eaad261037a5356a722856c3230df369f5d5e Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Mon, 11 Feb 2019 13:27:58 +0100 Subject: [PATCH] fix(bug): wrong order for preparing spec Signed-off-by: Tobias Gurtzick --- index.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 7c946d3..2a261bf 100644 --- a/index.js +++ b/index.js @@ -42,7 +42,7 @@ var Base = Class.extend({ ); }, - _prepareSpec: function(spec, options, tableName, columnName) { + _prepareSpec: function(columnName, spec, options, tableName) { if (spec.defaultValue.raw) { spec.defaultValue.prep = spec.defaultValue.raw; } else if (spec.defaultValue.special) { @@ -326,14 +326,9 @@ var Base = Class.extend({ }, addColumn: function(tableName, columnName, columnSpec, callback) { - var columnSpec = this.normalizeColumnSpec(columnSpec) + var columnSpec = this.normalizeColumnSpec(columnSpec); this._prepareSpec(columnName, columnSpec, columnDefOptions, tableName); - var def = this.createColumnDef( - columnName, - columnSpec, - {}, - tableName - ); + var def = this.createColumnDef(columnName, columnSpec, {}, tableName); var extensions = ''; var self = this;