Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
Resin
Server
Commits
300ab273
Commit
300ab273
authored
1 year ago
by
Marlène SIMONDANT
Browse files
Options
Downloads
Patches
Plain Diff
feat(structures) : migration script that adds label "Mes papiers"
parent
5a19db1f
No related branches found
No related tags found
2 merge requests
!299
V2.3.1
,
!295
[Label - Back] - Ajout du Label "Mes papiers""
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/migrations/scripts/1685536204579-add-label-my-papers.ts
+18
-0
18 additions, 0 deletions
src/migrations/scripts/1685536204579-add-label-my-papers.ts
with
18 additions
and
0 deletions
src/migrations/scripts/1685536204579-add-label-my-papers.ts
0 → 100644
+
18
−
0
View file @
300ab273
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
'
);
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment