Skip to content

Commit

Permalink
feat: added question and answer tables
Browse files Browse the repository at this point in the history
  • Loading branch information
uptownhr committed Aug 17, 2023
1 parent e2233a8 commit 597b3ed
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions libs/lov-db/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,37 @@ datasource db {

model Page {
id Int @id @default(autoincrement())
slug String @unique
title String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
questions Question[]
}

model Question {
id Int @id @default(autoincrement())
pageId Int
title String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
page Page @relation(fields: [pageId], references: [id])
answers Answer[]
}

model Answer {
id Int @id @default(autoincrement())
questionId Int
value String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
question Question @relation(fields: [questionId], references: [id])
}

0 comments on commit 597b3ed

Please sign in to comment.