20201106094956_active-projects-index-with-id.js 500 B

123456789101112131415161718192021
  1. const Helpers = require('./lib/helpers')
  2. exports.tags = ['server-ce', 'server-pro', 'saas']
  3. const index = {
  4. key: { _id: 1, lastOpened: 1, active: 1 },
  5. name: '_id_1_lastOpened_1_active_1',
  6. partialFilterExpression: {
  7. active: true,
  8. },
  9. }
  10. exports.migrate = async client => {
  11. const { db } = client
  12. await Helpers.addIndexesToCollection(db.projects, [index])
  13. }
  14. exports.rollback = async client => {
  15. const { db } = client
  16. await Helpers.dropIndexesFromCollection(db.projects, [index])
  17. }