Skip to content

Commit 735200f

Browse files
committed
Merge branch 'master' into master
2 parents 005c886 + 53e7337 commit 735200f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Schema.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,10 +409,14 @@ class Schema {
409409

410410
if (this.data[className][fieldName].startsWith('relation<')) {
411411
//For relations, drop the _Join table
412-
return database.collectionExists(`_Join:${fieldName}:${className}`).then(exist => {
413-
if (exist) {
414-
return database.dropCollection(`_Join:${fieldName}:${className}`);
412+
return database.dropCollection(`_Join:${fieldName}:${className}`)
413+
.then(() => {
414+
return Promise.resolve();
415+
}, error => {
416+
if (error.message == 'ns not found') {
417+
return Promise.resolve();
415418
}
419+
return Promise.reject(error);
416420
});
417421
}
418422

0 commit comments

Comments
 (0)