Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
aneeshd16 committed Mar 7, 2016
2 parents 005c886 + 53e7337 commit 735200f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,14 @@ class Schema {

if (this.data[className][fieldName].startsWith('relation<')) {
//For relations, drop the _Join table
return database.collectionExists(`_Join:${fieldName}:${className}`).then(exist => {
if (exist) {
return database.dropCollection(`_Join:${fieldName}:${className}`);
return database.dropCollection(`_Join:${fieldName}:${className}`)
.then(() => {
return Promise.resolve();
}, error => {
if (error.message == 'ns not found') {
return Promise.resolve();
}
return Promise.reject(error);
});
}

Expand Down

0 comments on commit 735200f

Please sign in to comment.