overleaf/services/web/migrations/20230616153016_user_features_updated_at_index.js
Jimmy Domagala-Tang 6ee5f6a0a0 Merge pull request #13497 from overleaf/jdt-extract-user-feature-set
Extract user feature set to analytics

GitOrigin-RevId: 41d25c9f32a01ffb27cf66217418d6014b20e841
2023-07-17 10:43:45 +00:00

22 lines
439 B
JavaScript

/* eslint-disable no-unused-vars */
const Helpers = require('./lib/helpers')
exports.tags = ['saas']
const index = {
key: {
featuresUpdatedAt: 1,
},
name: 'featuresUpdatedAt_1',
}
exports.migrate = async client => {
const { db } = client
await Helpers.addIndexesToCollection(db.users, [index])
}
exports.rollback = async client => {
const { db } = client
await Helpers.dropIndexesFromCollection(db.users, [index])
}