Created
January 15, 2023 00:33
-
-
Save hansputera/d09161574e656fdb7e87f9236be952a7 to your computer and use it in GitHub Desktop.
my prisma
This file contains hidden or 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
| generator client { | |
| provider = "prisma-client-js" | |
| } | |
| datasource db { | |
| provider = "mysql" | |
| url = env("DATABASE_URL") | |
| } | |
| model BrainlyAttachment { | |
| id Int @default(autoincrement()) @unique | |
| url String @db.VarChar(255) | |
| questionId Int? @unique | |
| answerId Int? @unique | |
| // relations | |
| question BrainlyQuestion? @relation(fields: [questionId], references: [id]) | |
| answer BrainlyAnswer? @relation(fields: [answerId], references: [id]) | |
| } | |
| model BrainlyUser { | |
| id Int @unique | |
| nick String @db.VarChar(255) | |
| avatarUrl String @db.VarChar(255) | |
| // relations | |
| questions BrainlyQuestion[] | |
| answers BrainlyAnswer[] | |
| } | |
| model BrainlyAnswer { | |
| id Int @unique | |
| questionId Int @unique | |
| userId Int @unique | |
| content String @db.LongText | |
| points Int @db.Int | |
| rating Int @db.SmallInt | |
| rates Int @db.TinyInt | |
| // relations | |
| question BrainlyQuestion @relation(fields: [questionId], references: [id]) | |
| user BrainlyUser @relation(fields: [userId], references: [id]) | |
| attachments BrainlyAttachment[] | |
| } | |
| model BrainlyQuestion { | |
| id Int @unique | |
| authorId Int @unique | |
| userId Int @unique | |
| content String @db.LongText | |
| subject String @db.VarChar(20) | |
| grade String @db.VarChar(255) | |
| lastActivity DateTime @db.DateTime() | |
| createdAt DateTime @db.DateTime() | |
| language String @db.VarChar(5) | |
| // relations | |
| attachments BrainlyAttachment[] | |
| answer BrainlyAnswer[] | |
| user BrainlyUser @relation(fields: [userId], references: [id]) | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment