Fixes
This commit is contained in:
37
server/prisma/migrations/20201231134732-init/schema.prisma
Normal file
37
server/prisma/migrations/20201231134732-init/schema.prisma
Normal file
@@ -0,0 +1,37 @@
|
||||
datasource db {
|
||||
provider = "sqlite"
|
||||
url = "***"
|
||||
}
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
model Link {
|
||||
id Int @id @default(autoincrement())
|
||||
createdAt DateTime @default(now())
|
||||
description String
|
||||
url String
|
||||
postedBy User @relation(fields: [postedById], references: [id])
|
||||
postedById Int
|
||||
votes Vote[]
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
email String @unique
|
||||
password String
|
||||
links Link[]
|
||||
votes Vote[]
|
||||
}
|
||||
|
||||
model Vote {
|
||||
id Int @id @default(autoincrement())
|
||||
link Link @relation(fields: [linkId], references: [id])
|
||||
linkId Int
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
userId Int
|
||||
|
||||
@@unique([linkId, userId])
|
||||
}
|
||||
Reference in New Issue
Block a user