Przeglądaj źródła

Create migration to add history display state index (#4335)

GitOrigin-RevId: 26a03c0192ae673110bfa65e0b293c586dc4958a
Thomas 5 lat temu
rodzic
commit
35ee137067

+ 22 - 0
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)
+}