Files
elternpass/prisma/schema.prisma

64 lines
1.7 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 String @id @default(uuid())
name String
birthDate DateTime
gender String? // can be "male", "female", "diverse", or "unknown"
userId String
user User @relation(fields: [userId], references: [id])
measurements Measurement[]
teeth ToothStatus[]
vaccines Vaccine[]
createdAt DateTime @default(now())
}
model Measurement {
id String @id @default(uuid())
childId String
child Child @relation(fields: [childId], references: [id])
date DateTime
weightKg Float?
heightCm Float?
createdAt DateTime @default(now())
}
model ToothStatus {
id String @id @default(uuid())
childId String
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 String @id @default(uuid())
childId String
child Child @relation(fields: [childId], references: [id])
name String
date DateTime
done Boolean @default(false)
notes String?
}