update prisma schema
This commit is contained in:
parent
43393b3fd3
commit
d94f22a3dc
|
|
@ -1,6 +1,7 @@
|
|||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
previewFeatures = ["referentialIntegrity"]
|
||||
output = "../.prisma/client"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
|
|
@ -13,24 +14,24 @@ model User {
|
|||
id Int @id @default(autoincrement())
|
||||
firstname String
|
||||
lastname String
|
||||
email String
|
||||
email String @unique
|
||||
password String
|
||||
posts Post[]
|
||||
roleId Int
|
||||
Role Role @relation(fields: [roleId], references: [id])
|
||||
role Role @default(USER)
|
||||
}
|
||||
|
||||
model Role {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
users User[]
|
||||
enum Role {
|
||||
USER
|
||||
ADMIN
|
||||
}
|
||||
|
||||
model Post {
|
||||
id Int @id @default(autoincrement())
|
||||
title String
|
||||
content String
|
||||
image String
|
||||
authorId Int
|
||||
author User @relation(fields: [authorId], references: [id])
|
||||
id Int @id @default(autoincrement())
|
||||
title String
|
||||
content String?
|
||||
image String?
|
||||
authorId Int
|
||||
author User @relation(fields: [authorId], references: [id])
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue