diff --git a/lib/adapters/postgres.js b/lib/adapters/postgres.js index 8bbb8d54..52701e04 100644 --- a/lib/adapters/postgres.js +++ b/lib/adapters/postgres.js @@ -164,7 +164,18 @@ PG.prototype.toDatabase = function (prop, val) { return this.toDatabase(prop, val[0]) + ' AND ' + this.toDatabase(prop, val[1]); } } - if (prop.type.name === 'Number') return val; + if (prop.type.name === 'Number') { + if (!val) { + if( prop.autoIncrement ) { + return 'DEFAULT'; + } + else { + return 'NULL'; + } + } + return val + }; + if (prop.type.name === 'Date') { if (!val) { if( prop.autoIncrement ) {