37 lines
891 B
Plaintext
37 lines
891 B
Plaintext
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
model Plan {
|
|
id String @id @default(cuid())
|
|
title String
|
|
password String
|
|
startDate DateTime
|
|
endDate DateTime
|
|
instructions String?
|
|
webhookUrl String?
|
|
notifyAll Boolean @default(true)
|
|
feedingPerDay Int @default(2)
|
|
feedingInterval Int @default(1)
|
|
litterInterval Int @default(2)
|
|
createdAt DateTime @default(now())
|
|
bookings Booking[]
|
|
}
|
|
|
|
model Booking {
|
|
id Int @id @default(autoincrement())
|
|
planId String
|
|
plan Plan @relation(fields: [planId], references: [id])
|
|
date DateTime
|
|
sitterName String?
|
|
type String @default("SITTER") // "SITTER" or "OWNER_HOME"
|
|
createdAt DateTime @default(now())
|
|
|
|
@@unique([planId, date, sitterName])
|
|
}
|