diff --git a/apps/meteor/server/startup/migrations/v305.ts b/apps/meteor/server/startup/migrations/v305.ts index bc58eab96965..d40314fc6a0d 100644 --- a/apps/meteor/server/startup/migrations/v305.ts +++ b/apps/meteor/server/startup/migrations/v305.ts @@ -9,8 +9,8 @@ addMigration({ version: 305, name: 'Convert retention policy max age from days to milliseconds', async up() { - // if the package value isn't 30 the setting has already been updated - await Settings.find({ _id: { $in: maxAgeSettings }, packageValue: 30 }, { projection: { _id: 1, value: 1 } }) + // if the package value isn't equal to the package value, we should update the values + await Settings.find({ _id: { $in: maxAgeSettings }, value: { $ne: 2592000000 } }, { projection: { _id: 1, value: 1 } }) .map(async ({ value, _id }) => { const newPackageValue = convertDaysToMs(30); const newValue = Number(value) >= 0 ? convertDaysToMs(Number(value)) : newPackageValue;