From 35ee137067ce5856b4ece12f9a6b216a8650b763 Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 26 Jul 2021 14:01:20 +0100 Subject: [PATCH] Create migration to add history display state index (#4335) GitOrigin-RevId: 26a03c0192ae673110bfa65e0b293c586dc4958a --- ...0721081758_create_history_display_index.js | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 services/web/migrations/20210721081758_create_history_display_index.js diff --git a/services/web/migrations/20210721081758_create_history_display_index.js b/services/web/migrations/20210721081758_create_history_display_index.js new file mode 100644 index 0000000000..db83fb5388 --- /dev/null +++ b/services/web/migrations/20210721081758_create_history_display_index.js @@ -0,0 +1,22 @@ +const Helpers = require('./lib/helpers') + +exports.tags = ['saas'] + +const indexes = [ + { + key: { + 'overleaf.history.display': 1, + }, + name: 'overleaf.history.display_1', + }, +] + +exports.migrate = async client => { + const { db } = client + await Helpers.addIndexesToCollection(db.projects, indexes) +} + +exports.rollback = async client => { + const { db } = client + await Helpers.dropIndexesFromCollection(db.projects, indexes) +}