62 lines
1.6 KiB
Plaintext
62 lines
1.6 KiB
Plaintext
// This is your Prisma schema file,
|
||
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||
|
||
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
||
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
||
|
||
generator client {
|
||
provider = "prisma-client-js"
|
||
}
|
||
|
||
datasource db {
|
||
provider = "postgresql"
|
||
url = env("DATABASE_URL")
|
||
}
|
||
model User {
|
||
id String @id @default(uuid())
|
||
email String @unique
|
||
name String?
|
||
password String @db.Text
|
||
children Child[]
|
||
createdAt DateTime @default(now())
|
||
}
|
||
|
||
model Child {
|
||
id Int @id @default(autoincrement())
|
||
name String
|
||
birthDate DateTime
|
||
userId String
|
||
user User @relation(fields: [userId], references: [id])
|
||
measurements Measurement[]
|
||
teeth ToothStatus[]
|
||
vaccines Vaccine[]
|
||
createdAt DateTime @default(now())
|
||
}
|
||
|
||
model Measurement {
|
||
id Int @id @default(autoincrement())
|
||
childId Int
|
||
child Child @relation(fields: [childId], references: [id])
|
||
date DateTime
|
||
weightKg Float?
|
||
heightCm Float?
|
||
}
|
||
|
||
model ToothStatus {
|
||
id Int @id @default(autoincrement())
|
||
childId Int
|
||
child Child @relation(fields: [childId], references: [id])
|
||
toothLabel String // z. B. "oben links 1" oder "Zahn 61"
|
||
date DateTime
|
||
status String // z. B. "durchgebrochen", "locker", "fehlend"
|
||
}
|
||
|
||
model Vaccine {
|
||
id Int @id @default(autoincrement())
|
||
childId Int
|
||
child Child @relation(fields: [childId], references: [id])
|
||
name String
|
||
date DateTime
|
||
done Boolean @default(false)
|
||
notes String?
|
||
} |