Skip to content

Commit

Permalink
fix migration check
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriellsh committed May 20, 2024
1 parent d24ba1b commit ed03337
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/meteor/server/startup/migrations/v305.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ed03337

Please sign in to comment.