-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd7f84c
commit f031173
Showing
4 changed files
with
56 additions
and
51 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
prisma/migrations/20231031232318_questios_and_answers_table/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,28 @@ | ||
-- CreateTable | ||
CREATE TABLE "question" ( | ||
"id" TEXT NOT NULL, | ||
"content" TEXT NOT NULL, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updated_at" TIMESTAMP(3), | ||
"author_id" TEXT NOT NULL, | ||
|
||
CONSTRAINT "question_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "answers" ( | ||
"id" TEXT NOT NULL, | ||
"content" TEXT NOT NULL, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updated_at" TIMESTAMP(3), | ||
"question_id" TEXT NOT NULL, | ||
"correct" BOOLEAN NOT NULL DEFAULT false, | ||
|
||
CONSTRAINT "answers_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "question" ADD CONSTRAINT "question_author_id_fkey" FOREIGN KEY ("author_id") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "answers" ADD CONSTRAINT "answers_question_id_fkey" FOREIGN KEY ("question_id") REFERENCES "question"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
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 was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
prisma/vitest-environment-prisma/prisma-test-environment.ts
This file was deleted.
Oops, something went wrong.