Initial commit: Projektstruktur mit Next.js, Prisma, tRPC, shadcn/ui, Landingpage und Registrierung
This commit is contained in:
61
prisma/schema.prisma
Normal file
61
prisma/schema.prisma
Normal file
@@ -0,0 +1,61 @@
|
||||
// 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?
|
||||
}
|
||||
Reference in New Issue
Block a user