-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MCR-4447: Q&A by rates database tables, domain types, and feature flag (
#2794) * Q&A by rates prisma update and migration. * RateQuestion domain type and zod schema * Add new flag to featureFlags
- Loading branch information
1 parent
dce091d
commit 29d33ec
Showing
5 changed files
with
139 additions
and
8 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
...-api/prisma/migrations/20240930221546_add_question_response_by_rates_tables/migration.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
BEGIN; | ||
|
||
-- CreateTable | ||
CREATE TABLE "RateQuestion" ( | ||
"id" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"rateID" TEXT NOT NULL, | ||
"addedByUserID" TEXT NOT NULL, | ||
"division" "Division" NOT NULL, | ||
|
||
CONSTRAINT "RateQuestion_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "RateQuestionResponse" ( | ||
"id" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"questionID" TEXT NOT NULL, | ||
"addedByUserID" TEXT NOT NULL, | ||
|
||
CONSTRAINT "RateQuestionResponse_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "RateQuestionDocument" ( | ||
"id" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"name" TEXT NOT NULL, | ||
"s3URL" TEXT NOT NULL, | ||
"questionID" TEXT NOT NULL, | ||
|
||
CONSTRAINT "RateQuestionDocument_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "RateQuestionResponseDocument" ( | ||
"id" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"s3URL" TEXT NOT NULL, | ||
"responseID" TEXT NOT NULL, | ||
|
||
CONSTRAINT "RateQuestionResponseDocument_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "RateQuestion" ADD CONSTRAINT "RateQuestion_rateID_fkey" FOREIGN KEY ("rateID") REFERENCES "RateTable"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "RateQuestion" ADD CONSTRAINT "RateQuestion_addedByUserID_fkey" FOREIGN KEY ("addedByUserID") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "RateQuestionResponse" ADD CONSTRAINT "RateQuestionResponse_questionID_fkey" FOREIGN KEY ("questionID") REFERENCES "RateQuestion"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "RateQuestionResponse" ADD CONSTRAINT "RateQuestionResponse_addedByUserID_fkey" FOREIGN KEY ("addedByUserID") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "RateQuestionDocument" ADD CONSTRAINT "RateQuestionDocument_questionID_fkey" FOREIGN KEY ("questionID") REFERENCES "RateQuestion"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "RateQuestionResponseDocument" ADD CONSTRAINT "RateQuestionResponseDocument_responseID_fkey" FOREIGN KEY ("responseID") REFERENCES "RateQuestionResponse"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
COMMIT; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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