[questions][feat] update vote enum

pull/323/head
hpkoh 3 years ago
parent a43e6455d6
commit caec7b57bc

@ -0,0 +1,30 @@
/*
Warnings:
- Changed the type of `vote` on the `QuestionsAnswerCommentVote` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
- Changed the type of `vote` on the `QuestionsAnswerVote` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
- Changed the type of `vote` on the `QuestionsQuestionCommentVote` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
- Changed the type of `vote` on the `QuestionsQuestionVote` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
*/
-- CreateEnum
CREATE TYPE "Vote" AS ENUM ('UPVOTE', 'DOWNVOTE');
-- AlterTable
ALTER TABLE "QuestionsAnswerCommentVote" DROP COLUMN "vote",
ADD COLUMN "vote" "Vote" NOT NULL;
-- AlterTable
ALTER TABLE "QuestionsAnswerVote" DROP COLUMN "vote",
ADD COLUMN "vote" "Vote" NOT NULL;
-- AlterTable
ALTER TABLE "QuestionsQuestionCommentVote" DROP COLUMN "vote",
ADD COLUMN "vote" "Vote" NOT NULL;
-- AlterTable
ALTER TABLE "QuestionsQuestionVote" DROP COLUMN "vote",
ADD COLUMN "vote" "Vote" NOT NULL;
-- DropEnum
DROP TYPE "QuestionsVote";

@ -60,6 +60,11 @@ model User {
questionsAnswerCommentVotes QuestionsAnswerCommentVote[] questionsAnswerCommentVotes QuestionsAnswerCommentVote[]
} }
enum Vote {
UPVOTE
DOWNVOTE
}
model VerificationToken { model VerificationToken {
identifier String identifier String
token String @unique token String @unique
@ -172,12 +177,6 @@ model ResumesCommentVote {
// use camelCase for field names, and try to name them consistently // use camelCase for field names, and try to name them consistently
// across all models in this file. // across all models in this file.
enum QuestionsVote {
NO_VOTE
UPVOTE
DOWNVOTE
}
enum QuestionsQuestionType { enum QuestionsQuestionType {
CODING CODING
SYSTEM_DESIGN SYSTEM_DESIGN
@ -218,7 +217,7 @@ model QuestionsQuestionVote {
id String @id @default(cuid()) id String @id @default(cuid())
questionId String questionId String
userId String? userId String?
vote QuestionsVote vote Vote
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
@ -245,7 +244,7 @@ model QuestionsQuestionCommentVote {
id String @id @default(cuid()) id String @id @default(cuid())
questionCommentId String questionCommentId String
userId String? userId String?
vote QuestionsVote vote Vote
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
@ -273,7 +272,7 @@ model QuestionsAnswerVote {
id String @id @default(cuid()) id String @id @default(cuid())
answerId String answerId String
userId String? userId String?
vote QuestionsVote vote Vote
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
@ -300,7 +299,7 @@ model QuestionsAnswerCommentVote {
id String @id @default(cuid()) id String @id @default(cuid())
answerCommentId String answerCommentId String
userId String? userId String?
vote QuestionsVote vote Vote
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt

Loading…
Cancel
Save