50 lines
1010 B
Plaintext
50 lines
1010 B
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"
|
|
output = "../generated/prisma"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model AlarmGroup {
|
|
id Int @id @default(autoincrement())
|
|
name String
|
|
zone String
|
|
state AlarmGroupState
|
|
Alarm Alarm[]
|
|
|
|
mo Boolean
|
|
tu Boolean
|
|
we Boolean
|
|
th Boolean
|
|
fr Boolean
|
|
sa Boolean
|
|
su Boolean
|
|
repeats Boolean
|
|
}
|
|
|
|
enum AlarmGroupState {
|
|
idle
|
|
snooze
|
|
stop
|
|
ringing
|
|
}
|
|
|
|
model Alarm {
|
|
id Int @id @default(autoincrement())
|
|
time String
|
|
nextRing DateTime
|
|
|
|
// AlarmGroup FK
|
|
AlarmGroupId Int
|
|
AlarmGroup AlarmGroup @relation(fields: [AlarmGroupId], references: [id])
|
|
}
|