-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: migration script to add identifier to layouts #3967
feat: migration script to add identifier to layouts #3967
Conversation
const layouts = await layoutRepository.find({ | ||
_organizationId: organization._id, | ||
_parentId: { $exists: false, $eq: null }, | ||
identifier: { $exists: false, $eq: null }, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get the dev environments layouts that doesn't have identifier
{ | ||
updateOne: { | ||
filter: { _parentId: _id, _organizationId: organization._id }, | ||
update: { $set: { identifier } }, | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add an update for the prod environment with that same identifier
console.log( | ||
`${bulkResponse.result.nMatched} matched, ${ | ||
bulkResponse.result.nModified | ||
} modified, ${bulkResponse.getWriteErrorCount()} errors` | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not sure how detailed the log should be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good :)
What change does this PR introduce?
Migration script to add identifier field to layouts
Why was this change needed?
Other information (Screenshots)