This commit is contained in:
Drew
2016-05-26 16:15:54 -07:00
committed by Florent Vilmart
parent c5e3be8b64
commit 50b9ae4803
2 changed files with 18 additions and 1 deletions

View File

@@ -67,7 +67,7 @@ function modifySchema(req) {
// A helper function that removes all join tables for a schema. Returns a promise.
var removeJoinTables = (database, mongoSchema) => {
return Promise.all(Object.keys(mongoSchema)
.filter(field => mongoSchema[field].startsWith('relation<'))
.filter(field => field !== '_metadata' && mongoSchema[field].startsWith('relation<'))
.map(field => {
let collectionName = `_Join:${field}:${mongoSchema._id}`;
return database.adapter.deleteOneSchema(collectionName);