Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 72c4518555
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ritamzico
added this pull request to stack #1205
September 9, 2026 21:28
Add an idempotent, dry-run-capable migration that copies canonical majors and minors from each user’s plan without overwriting existing profile values. Enforce the one-plan-per-user invariant with a unique userEmail index. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QNN5LA8L23gjK9vEsKHAVV
ritamzico
force-pushed
the
ritam/backfill-user-major-from-gradtrak
branch
from
September 9, 2026 21:47
72c4518 to
e576f65
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
user.majorsanduser.minorsfields from each user's GradTrak planPR Canonical degree vocabulary + user major API #1187
plans.userEmailto enforce one plan per user at thedatabase layer
This PR is stacked on #1187 (
ritam/major-vocabulary-plumbing); review and mergethat PR first.
Production data findings
The initial read-only audit found:
user migration; these values are intentionally never overwritten
The audit also found 18 duplicate
plan.userEmailgroups containing 43superseded plans. Per Ritam's decision, the older plans were archived intact in
plans_duplicate_archive_pr2_20260909and removed, retaining the newest plan foreach user. Production now has zero duplicate groups.
The
plans.userEmail_1unique index has already been built and verified manuallyin production. No additional manual index build is required after deployment;
the schema declaration keeps the invariant in code and applies it to other
environments.
Migration behavior
The migration processes plans in batches of 500 and:
DRY_RUN=1, logging every proposed change without writingnullskip category
It is safe to rerun. After a successful live run, migrated users fall into the
already-set category.
Latest production dry-run snapshot (2026-09-09):
The live backfill has intentionally not been run. It will be executed immediately
before the profile major/minor editor is enabled.
Usage
Verification
npm run type-check --workspace=apps/backendnpm run lint --workspace=apps/backendnpx tsc -p packages/common/tsconfig.json --noEmit🤖 Generated with Claude Code
https://claude.ai/code/session_01QNN5LA8L23gjK9vEsKHAVV