Add semester season property from semester type#593
Conversation
|
[diff-counting] Significant lines: 48. |
|
Visit the preview URL for this PR (updated for commit 1d5ec49): https://cornelldti-courseplan-dev--pr593-ben-semester-season-f322e1pe.web.app (expires Tue, 23 Nov 2021 22:28:40 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
| // each semester should have type but not necessarily season | ||
| ({ ...semester, season: semester.season || semester.type }) |
There was a problem hiding this comment.
maybe also do some cleanup to remove the old type field?
There was a problem hiding this comment.
There's currently still a dependency on type in the code. There was probably a better way to do it 😭 but I plan on doing the cleanup in a future script.
There was a problem hiding this comment.
Oh, I remember why I did it this way. It was because I didn't want to update the database schema while prod and other devs were still using type, so I split up the migration into multiple parts
Summary
This pull request is a script to migrate all old instances of semester type to semester season. After this, the schema will include identical values for
typeandseason(instead of just includingtype). I ran it on dev, it just needs to be run on prod.Depends on #546
Test Plan
npm run ts-node -- src/requirements/admin/semester-season-migration <user email>to dry-run on a single user.npm run ts-node -- src/requirements/admin/semester-season-migration --run-on-dbto run on the entire database.