betagouv/service-national-universel

View on GitHub
api/migrations/20240704135227-set-old-classes-status-to-CLOSED.js

Summary

Maintainability
A
0 mins
Test Coverage
const { ClasseModel } = require("../src/models");
const { STATUS_CLASSE } = require("snu-lib");
module.exports = {
  async up() {
    await ClasseModel.updateMany({ status: { $ne: STATUS_CLASSE.WITHDRAWN } }, { $set: { status: STATUS_CLASSE.CLOSED } });
  },
};