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
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
2a38e428
Commit
2a38e428
authored
1 year ago
by
Marlène SIMONDANT
Browse files
Options
Downloads
Patches
Plain Diff
refactor(db): rename categories/onlineProcedures/foreigners
parent
650b3ebb
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!375
V3.0.0
,
!367
refactor(DB): rename categories/onlineProcedures/foreigners
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/migrations/scripts/1708596285177-rename-foreigners.ts
+34
-0
34 additions, 0 deletions
src/migrations/scripts/1708596285177-rename-foreigners.ts
with
34 additions
and
0 deletions
src/migrations/scripts/1708596285177-rename-foreigners.ts
0 → 100644
+
34
−
0
View file @
2a38e428
import
{
Db
}
from
'
mongodb
'
;
import
{
getDb
}
from
'
../migrations-utils/db
'
;
export
const
up
=
async
()
=>
{
try
{
const
db
:
Db
=
await
getDb
();
await
db
.
collection
(
'
categories
'
)
.
updateOne
(
{
id
:
'
onlineProcedures
'
,
'
modules.id
'
:
'
foreigners
'
},
{
$set
:
{
'
modules.$.name
'
:
'
Titres de séjour, de voyage (ANEF)
'
}
}
);
console
.
log
(
'
Update done: "Démarches liées aux étrangers" -> "Titres de séjour, de voyage (ANEF)"
'
);
}
catch
(
error
)
{
console
.
error
(
`Error updating categories/onlineProcedures/foreigners' name :
${
error
}
`
);
}
};
export
const
down
=
async
()
=>
{
try
{
const
db
:
Db
=
await
getDb
();
await
db
.
collection
(
'
categories
'
)
.
updateOne
(
{
id
:
'
onlineProcedures
'
,
'
modules.id
'
:
'
foreigners
'
},
{
$set
:
{
'
modules.$.name
'
:
'
Démarches liées aux étrangers
'
}
}
);
console
.
log
(
'
Downgrade done: "Titres de séjour, de voyage (ANEF)" -> "Démarches liées aux étrangers"
'
);
}
catch
(
error
)
{
console
.
error
(
`Error updating categories/onlineProcedures/foreigners' name :
${
error
}
`
);
}
};
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