|
|
@@ -1,5 +1,3 @@
|
|
|
-/* eslint-disable no-unused-vars */
|
|
|
-
|
|
|
const Helpers = require('./lib/helpers')
|
|
|
|
|
|
exports.tags = ['server-ce', 'server-pro', 'saas']
|
|
|
@@ -14,18 +12,12 @@ const indexes = [
|
|
|
},
|
|
|
]
|
|
|
|
|
|
-exports.migrate = async client => {
|
|
|
- const { db } = client
|
|
|
-
|
|
|
- await Helpers.addIndexesToCollection(db.docOps, indexes)
|
|
|
+exports.migrate = async ({ nativeDb }) => {
|
|
|
+ const docOps = nativeDb.collection('docOps')
|
|
|
+ await Helpers.addIndexesToCollection(docOps, indexes)
|
|
|
}
|
|
|
|
|
|
-exports.rollback = async client => {
|
|
|
- const { db } = client
|
|
|
-
|
|
|
- try {
|
|
|
- await Helpers.dropIndexesFromCollection(db.docOps, indexes)
|
|
|
- } catch (err) {
|
|
|
- console.error('Something went wrong rolling back the migrations', err)
|
|
|
- }
|
|
|
+exports.rollback = async ({ nativeDb }) => {
|
|
|
+ const docOps = nativeDb.collection('docOps')
|
|
|
+ await Helpers.dropIndexesFromCollection(docOps, indexes)
|
|
|
}
|