Files

51 lines
1.0 KiB
Plaintext
Raw Permalink Normal View History

2025-10-22 06:12:25 -04:00
// 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"
output = "../generated/prisma"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model AlarmGroup {
2025-10-22 15:01:08 -04:00
id Int @id @default(autoincrement())
2025-10-22 06:12:25 -04:00
name String
2025-10-22 15:01:08 -04:00
zone String
2025-10-22 06:12:25 -04:00
state AlarmGroupState
2025-10-22 15:01:08 -04:00
Alarm Alarm[]
2025-10-22 06:12:25 -04:00
2025-10-22 15:01:08 -04:00
mo Boolean
tu Boolean
we Boolean
th Boolean
fr Boolean
sa Boolean
su Boolean
repeats Boolean
2025-10-22 06:12:25 -04:00
}
enum AlarmGroupState {
idle
2025-10-22 15:01:08 -04:00
snooze
stop
ringing
2025-10-22 06:12:25 -04:00
}
model Alarm {
2025-10-22 15:20:13 -04:00
secondsSinceMidnight Int
nextRing DateTime
2025-10-22 06:12:25 -04:00
// AlarmGroup FK
AlarmGroupId Int
AlarmGroup AlarmGroup @relation(fields: [AlarmGroupId], references: [id])
2025-10-22 15:20:13 -04:00
@@id([secondsSinceMidnight, AlarmGroupId])
2025-10-22 06:12:25 -04:00
}