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:
Drew
2016-04-13 16:45:07 -07:00
committed by Florent Vilmart
parent 3fb3ce1ab7
commit fc1cdd4408
8 changed files with 43 additions and 76 deletions

View File

@@ -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);
});
}