Skip to content

Add Script to Migrate Emails from profiles to users collection#2054

Open
kiminkim724 wants to merge 1 commit intocodeforboston:mainfrom
kiminkim724:migrate-profile-emails
Open

Add Script to Migrate Emails from profiles to users collection#2054
kiminkim724 wants to merge 1 commit intocodeforboston:mainfrom
kiminkim724:migrate-profile-emails

Conversation

@kiminkim724
Copy link
Collaborator

Summary

This script migrates email addresses from the profiles collection to the users collection in Firestore.

  • For each profile document with an email:
    • Checks if the corresponding user document already has an email.
      • If the user document does not have an email:
        • Copies the email from profiles to users.
        • Deletes the email field from the profile document.
      • If the emails are the same:
        • Deletes the email field from the profile document.
      • If the emails are different:
        • Logs an error with the user ID and both email values, then skips updating.

Checklist

  • On the frontend, I've made my strings translate-able.
  • If I've added shared components, I've added a storybook story.
  • I've made pages responsive and look good on mobile.
  • If I've added new Firestore queries, I've added any new required indexes to firestore.indexes.json (Please do not only create indexes through the Firebase Web UI, even though the error messages may reccommend it - indexes created this way may be obliterated by subsequent deploys)

Screenshots

Add some screenshots highlighting your changes.

Known issues

If you've run against limitations or caveats, include them here. Include follow-up issues as well.

Steps to test/reproduce

For each feature or bug fix, create a step by step list for how a reviewer can test it out. E.g.:

  1. yarn firebase-admin -e local run-script migrateProfileEmails
  2. Check if emails are migrated over properly

@vercel
Copy link

vercel bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
maple-dev Ready Ready Preview, Comment Mar 4, 2026 1:29am

Request Review

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.

1 participant