Skip to content
Snippets Groups Projects
Commit 300ab273 authored by Marlène SIMONDANT's avatar Marlène SIMONDANT
Browse files

feat(structures) : migration script that adds label "Mes papiers"

parent 5a19db1f
No related branches found
No related tags found
2 merge requests!299V2.3.1,!295[Label - Back] - Ajout du Label "Mes papiers""
import { Db } from 'mongodb';
import { getDb } from '../migrations-utils/db';
export const up = async () => {
const db: Db = await getDb();
await db
.collection('categories')
.updateOne({ id: 'labelsQualifications' }, { $push: { modules: { id: 'mesPapiers', name: 'Mes Papiers' } } });
console.log('Updated : "Mes papiers" added to "labelsQualifications" document in "categories" collection');
};
export const down = async () => {
const db: Db = await getDb();
await db
.collection('categories')
.updateOne({ id: 'labelsQualifications' }, { $pull: { modules: { id: 'mesPapiers', name: 'Mes Papiers' } } });
console.log('Downgraded : "Mes papiers" removed from "labelsQualifications" document in "categories" collection');
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment