We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Create the prisma schema for the quizzes with the types given in #41 as base.
Here is a first version (not final) :
model QuestionResult { id Int @id @default(autoincrement()) @db.UnsignedInt user_id Int @db.UnsignedInt country_id Int @db.UnsignedInt learning_type LearningType @default(capital) result Score @default(succeeded) created_at DateTime @default(now()) @db.Timestamp(0) country Country @relation(fields: [country_id], references: [id]) @@index([country_id]) } model QuizQuestion { id Int @id @default(autoincrement()) @db.UnsignedInt question String @db.VarChar(255) Quiz Quiz? @relation(fields: [quizId], references: [id]) quizId Int? @db.UnsignedInt QuizAnswer QuizAnswer[] } model QuizAnswer { id Int @id @default(autoincrement()) @db.UnsignedInt answer AnswerType @default(capital) is_correct Boolean quizId Int @db.UnsignedInt Quiz Quiz @relation(fields: [quizId], references: [id]) question_id Int @db.UnsignedInt QuizQuestion QuizQuestion @relation(fields: [question_id], references: [id]) @@index([quizId], map: "idx_quizanswer_quiz_id") @@index([question_id], map: "idx_quizanswer_question_id") } model Quiz { id Int @id @default(autoincrement()) @db.UnsignedInt name String @db.VarChar(255) difficulty Int @db.UnsignedInt theme String @db.VarChar(255) description String @db.VarChar(255) questions QuizQuestion[] answers QuizAnswer[] created_at DateTime @default(now()) @db.Timestamp(0) updated_at DateTime? @default(now()) @db.DateTime(0) user_id Int @db.UnsignedInt QuizResult QuizResult[] @@index([name], map: "idx_quiz_name") } model QuizResult { id Int @id @default(autoincrement()) @db.UnsignedInt quiz_id Int @db.UnsignedInt user_id Int @db.UnsignedInt result Int @db.UnsignedInt created_at DateTime @default(now()) @db.Timestamp(0) quiz Quiz @relation(fields: [quiz_id], references: [id]) @@index([quiz_id], map: "idx_quizresult_quiz_id") }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Create the prisma schema for the quizzes with the types given in #41 as base.
Here is a first version (not final) :
The text was updated successfully, but these errors were encountered: