Skip to content

Commit

Permalink
feat: migration des organismes avec paramétrage incomplet
Browse files Browse the repository at this point in the history
  • Loading branch information
totakoko committed Oct 12, 2023
1 parent 78195cb commit 7c1d185
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Db } from "mongodb";

export const up = async (db: Db) => {
// Certains organismes ont un mode de transmission défini à API sans ERPs.
// On réinitialise cette configuration incomplète pour les forcer à reparamétrer leur organisme.
await db.collection("organismes").updateMany(
{
mode_de_transmission: "API",
erps: [],
},
{
$unset: {
mode_de_transmission: 1,
},
},
{
bypassDocumentValidation: true,
}
);
};

0 comments on commit 7c1d185

Please sign in to comment.