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

update(scripts): update migration scripts to use updateOne #15181

Open
wants to merge 7 commits into
base: release
Choose a base branch
from

Conversation

CuriousMagpie
Copy link
Member

@CuriousMagpie CuriousMagpie commented Mar 25, 2024

Updates to the following migration scripts:

  • bulk-email.js
  • full-gear.js
  • habit_birthday.js
  • nye.js
  • pet_group_achievements.js
  • pi-day
  • summer_splash_orcas.js
  • take-this.js
  • veteran_pet_ladder

I have also done a little bit of code clean-up.

I have tested these scripts locally and they do what they're supposed to do.

@CuriousMagpie CuriousMagpie marked this pull request as ready for review March 25, 2024 22:57
Copy link
Member

@negue negue left a comment

Choose a reason for hiding this comment

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

yeah we should use more updateOne's more, less Database spam 😬

just one line was off , the rest LGTM

@@ -57,7 +57,7 @@ async function updateUser (user) {
export default async function processUsers () {
const query = {
migration: { $ne: MIGRATION_NAME },
'auth.local.username': 'SabreTest',
'auth.local.lowerCaseUsername': 'SabreTest',
Copy link
Member

Choose a reason for hiding this comment

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

was this intended? or some global replace happened 😬

Copy link
Member Author

Choose a reason for hiding this comment

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

It was intentional, but I should have changed the username to match. We mainly use that field when we're testing migrations on our test accounts. 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants