Remove collection prefix and default mongo URI (#1479)
* Remove collection prefix from DB Controller * Remove collection prefix from cache * Revert "Remove collection prefix from cache" This reverts commit 529d67dd617b64c69c36a8a63382456e95edcab8. * Remove knowledge of default mongo URI from Parse Server * Remove adaptive collection paramater from deleteFields * Tidy up DBAdapter.js
This commit is contained in:
@@ -525,9 +525,7 @@ class Schema {
|
||||
|
||||
if (this.data[className][fieldName].type == 'Relation') {
|
||||
//For relations, drop the _Join table
|
||||
return database.adaptiveCollection(className).then(collection => {
|
||||
return database.adapter.deleteFields(className, [fieldName], [], database.collectionPrefix, collection);
|
||||
})
|
||||
return database.adapter.deleteFields(className, [fieldName], [])
|
||||
.then(() => database.dropCollection(`_Join:${fieldName}:${className}`))
|
||||
.catch(error => {
|
||||
// 'ns not found' means collection was already gone. Ignore deletion attempt.
|
||||
@@ -541,8 +539,7 @@ class Schema {
|
||||
|
||||
const fieldNames = [fieldName];
|
||||
const pointerFieldNames = this.data[className][fieldName].type === 'Pointer' ? [fieldName] : [];
|
||||
return database.adaptiveCollection(className)
|
||||
.then(collection => database.adapter.deleteFields(className, fieldNames, pointerFieldNames, database.collectionPrefix, collection));
|
||||
return database.adapter.deleteFields(className, fieldNames, pointerFieldNames);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user