mirror of
https://github.com/knex/knex.git
synced 2025-10-02 11:37:26 +00:00
Compile result of .defaultsTo(null) to "default null", not "default 'null'"
This commit is contained in:
parent
289c661152
commit
3d3e4036bb
@ -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;
|
||||
module.exports = ColumnCompiler;
|
||||
|
Loading…
x
Reference in New Issue
Block a user