diff --git a/lib/schema/columncompiler.js b/lib/schema/columncompiler.js index 4b69e40b..52d4fd76 100644 --- a/lib/schema/columncompiler.js +++ b/lib/schema/columncompiler.js @@ -110,6 +110,8 @@ ColumnCompiler.prototype.notNullable = function() { ColumnCompiler.prototype.defaultTo = function(value) { if (value === void 0) { return ''; + } else if (value === null) { + value = "null"; } else if (value instanceof Raw) { value = value.toQuery(); } else if (this.type === 'bool') { @@ -128,4 +130,4 @@ ColumnCompiler.prototype._num = function(val, fallback) { return isNaN(number) ? fallback : number; }; -module.exports = ColumnCompiler; \ No newline at end of file +module.exports = ColumnCompiler;