From 9fad1844fbcb3ab660f16e009220854842a9030e Mon Sep 17 00:00:00 2001 From: Terence Ho <> Date: Thu, 13 Oct 2022 11:21:07 +0800 Subject: [PATCH] [resumes][refactor] use Vote enum in ResumesCommentVote --- .../migration.sql | 9 +++++++++ apps/portal/prisma/schema.prisma | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 apps/portal/prisma/migrations/20221013032033_update_resume_vote_to_enum/migration.sql diff --git a/apps/portal/prisma/migrations/20221013032033_update_resume_vote_to_enum/migration.sql b/apps/portal/prisma/migrations/20221013032033_update_resume_vote_to_enum/migration.sql new file mode 100644 index 00000000..935df922 --- /dev/null +++ b/apps/portal/prisma/migrations/20221013032033_update_resume_vote_to_enum/migration.sql @@ -0,0 +1,9 @@ +/* + Warnings: + + - Changed the type of `value` on the `ResumesCommentVote` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required. + +*/ +-- AlterTable +ALTER TABLE "ResumesCommentVote" DROP COLUMN "value", +ADD COLUMN "value" "Vote" NOT NULL; diff --git a/apps/portal/prisma/schema.prisma b/apps/portal/prisma/schema.prisma index 27a1d7c5..9ce74736 100644 --- a/apps/portal/prisma/schema.prisma +++ b/apps/portal/prisma/schema.prisma @@ -159,7 +159,7 @@ model ResumesCommentVote { id String @id @default(cuid()) userId String commentId String - value Int + value Vote createdAt DateTime @default(now()) updatedAt DateTime @updatedAt comment ResumesComment @relation(fields: [commentId], references: [id], onDelete: Cascade)