Skip to content

Commit

Permalink
fix: error dataGouvOrganizationId empty
Browse files Browse the repository at this point in the history
  • Loading branch information
fufeck committed Jul 1, 2024
1 parent cca9cdd commit eb44f98
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions server/migrations/24-07-01_empty-dataGouvOrganizationId.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const mongoClient = require("../utils/mongo-client");

const collectionName = "partenaires-de-la-charte";

async function main() {
await mongoClient.connect();

await mongoClient.db.collection(collectionName).updateMany(
{ dataGouvOrganizationId: [""] },
{
$set: {
dataGouvOrganizationId: [],
},
}
);

await mongoClient.disconnect();
}

main()
.catch((error) => {
console.error(error);
process.exit(1);
})
.then(() => {
process.exit(0);
});

0 comments on commit eb44f98

Please sign in to comment.