Skip to content
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

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

ainouzgali
Copy link
Contributor

What change does this PR introduce?

Migration script to add identifier field to layouts

Why was this change needed?

Other information (Screenshots)

@linear
Copy link

linear bot commented Aug 14, 2023

Comment on lines +21 to +25
const layouts = await layoutRepository.find({
_organizationId: organization._id,
_parentId: { $exists: false, $eq: null },
identifier: { $exists: false, $eq: null },
});
Copy link
Contributor Author

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

Comment on lines +39 to +44
{
updateOne: {
filter: { _parentId: _id, _organizationId: organization._id },
update: { $set: { identifier } },
},
},
Copy link
Contributor Author

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

Comment on lines +56 to +60
console.log(
`${bulkResponse.result.nMatched} matched, ${
bulkResponse.result.nModified
} modified, ${bulkResponse.getWriteErrorCount()} errors`
);
Copy link
Contributor Author

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

Base automatically changed from nv-2690-add-identifier-field-to-layouts-schemeapi-migration to next August 15, 2023 12:27
Copy link
Contributor

@LetItRock LetItRock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good :)

@ainouzgali ainouzgali added this pull request to the merge queue Aug 16, 2023
Merged via the queue into next with commit e697121 Aug 16, 2023
16 checks passed
@ainouzgali ainouzgali deleted the nv-2699-migration-script-add-layout-identifier branch August 16, 2023 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants