Files
elternpass/prisma/schema.prisma

61 lines
1.6 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 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?
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?
}