37 lines
767 B
Plaintext
37 lines
767 B
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
previewFeatures = ["referentialIntegrity"]
|
|
}
|
|
|
|
datasource db {
|
|
provider = "mysql"
|
|
url = env("DATABASE_URL")
|
|
referentialIntegrity = "prisma"
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
firstname String
|
|
lastname String
|
|
email String
|
|
password String
|
|
posts Post[]
|
|
roleId Int
|
|
Role Role @relation(fields: [roleId], references: [id])
|
|
}
|
|
|
|
model Role {
|
|
id Int @id @default(autoincrement())
|
|
name String
|
|
users User[]
|
|
}
|
|
|
|
model Post {
|
|
id Int @id @default(autoincrement())
|
|
title String
|
|
content String
|
|
image String
|
|
authorId Int
|
|
author User @relation(fields: [authorId], references: [id])
|
|
}
|