From cd23df1bb152cf1a5cfaf188ada091bfe7f3dff8 Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Tue, 16 May 2023 19:41:10 +0200 Subject: [PATCH] Merge pull request #13082 from overleaf/msm-migration-check-history [web/migrations] Check Full History Migration in CE/SP GitOrigin-RevId: 567e7146511710ef4d79c201f5c31863d5be664e --- .../20230512100122_ensure_history_migration.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 services/web/migrations/20230512100122_ensure_history_migration.js diff --git a/services/web/migrations/20230512100122_ensure_history_migration.js b/services/web/migrations/20230512100122_ensure_history_migration.js new file mode 100644 index 0000000000..fda5e67950 --- /dev/null +++ b/services/web/migrations/20230512100122_ensure_history_migration.js @@ -0,0 +1,17 @@ +exports.tags = ['server-ce', 'server-pro'] + +exports.migrate = async client => { + const { db } = client + const count = await db.projects.countDocuments({ + 'overleaf.history.display': { $ne: true }, + }) + if (count > 0) { + throw new Error( + `Found ${count} projects not migrated to Full Project History` + ) + } +} + +exports.rollback = async client => { + // Not applicable +}