mirror of
https://github.com/Floriansylvain/ParisMuseesQuizz.git
synced 2026-08-19 11:43:22 +02:00
53 lines
1.4 KiB
Plaintext
53 lines
1.4 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "mysql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
email String @unique
|
|
password String
|
|
name String
|
|
created_at DateTime @default(now())
|
|
updated_at DateTime @updatedAt
|
|
}
|
|
|
|
model Author {
|
|
id Int @id @default(autoincrement())
|
|
fullname String @unique
|
|
created_at DateTime @default(now())
|
|
updated_at DateTime @updatedAt
|
|
PaintingAuthor PaintingAuthor[]
|
|
}
|
|
|
|
model Painting {
|
|
id Int @id @default(autoincrement())
|
|
name String @unique
|
|
image_url String
|
|
link String
|
|
PaintingAuthor PaintingAuthor[]
|
|
Musuem Musuem? @relation(fields: [musuemId], references: [id])
|
|
musuemId Int?
|
|
}
|
|
|
|
model PaintingAuthor {
|
|
painting Painting @relation(fields: [painting_id], references: [id])
|
|
painting_id Int
|
|
author Author @relation(fields: [author_id], references: [id])
|
|
author_id Int
|
|
|
|
@@id([painting_id, author_id])
|
|
}
|
|
|
|
model Musuem {
|
|
id Int @id @default(autoincrement())
|
|
name String @unique
|
|
created_at DateTime @default(now())
|
|
updated_at DateTime @updatedAt
|
|
Painting Painting[]
|
|
}
|