-
Notifications
You must be signed in to change notification settings - Fork 3
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
Connect QA to Contracts #2027
Connect QA to Contracts #2027
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I think we should make rates-db-refactor
a prerequisite for cms-questions
since this feature no longer works without the refactor.
createdAt DateTime @default(now()) | ||
updatedAt DateTime @default(now()) @updatedAt | ||
pkgID String | ||
pkg HealthPlanPackageTable @relation(fields: [pkgID], references: [id]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With these changes to Question
and HealthPlanPackageTable
, would we want to make a migration or drop the Q&A tables? I think this only applies to Val
since it is the only environment that has existing Q&A records.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a closer look at that migration! All the Questions that were associated with HPP should now be associated with Contracts
ALTER TABLE "Question" ADD CONSTRAINT "Question_contractID_fkey" FOREIGN KEY ("contractID") REFERENCES "ContractTable"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- migrate data over | ||
UPDATE "Question" SET "contractID"="pkgID"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where we copy all the pkgIDs into contractIDs
The way this works is that we don't add the NOT NULL constraint until after we copy this over.
then we can safely drop the pkgID column
rateDateCertified DateTime? @db.Date | ||
amendmentEffectiveDateStart DateTime? @db.Date | ||
amendmentEffectiveDateEnd DateTime? @db.Date | ||
rateProgramIDs String[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm maybe we need to build in prisma formatting into our precommit scripts. I've been noticing these kind of formatting difff on our prisma PRs over the last few months
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Don't forget turning Cypress back on as a follow on here.
Summary
This PR changes Questions to be related to the ContractTable rather than the HPPTable and migrates all existing Questions over to the new table (these only exist in dev/val)
When we add questions to Rates it will add complexity but this PR is pretty simple.
Joy: almost all the code changes were driven by compiler errors.
Related issues
https://qmacbis.atlassian.net/browse/MCR-2640
QA guidance
Should be able to create questions in environments with the db refactor (which is all of them now)