Add more postgres support (#2080)

* reload the right data

More passing postgres tests

Handle schema updates, and $in for non array columns

remove authdata from user and implement ensureUniqueness

Make some tests work, detect existing classes

Throw proper error for unique index violation

* fix findOneAndUpdate
This commit is contained in:
Drew
2016-06-16 15:39:05 -07:00
committed by Peter J. Shin
parent 1a75101146
commit 0ff35e18f0
8 changed files with 194 additions and 127 deletions

View File

@@ -418,6 +418,7 @@ DatabaseController.prototype.create = function(className, object, { acl } = {})
return (isMaster ? Promise.resolve() : schemaController.validatePermission(className, aclGroup, 'create'))
.then(() => this.handleRelationUpdates(className, null, object))
.then(() => schemaController.enforceClassExists(className))
.then(() => schemaController.reloadData())
.then(() => schemaController.getOneSchema(className, true))
.then(schema => this.adapter.createObject(className, SchemaController.convertSchemaToAdapterSchema(schema), object))
.then(result => sanitizeDatabaseResult(originalObject, result.ops[0]));