43 lines
1.3 KiB
Plaintext
43 lines
1.3 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Device {
|
|
id String @id @default(cuid())
|
|
serialNumber String @unique
|
|
macAddress String @unique
|
|
name String? @default("Unnamed Device")
|
|
status String @default("PENDING") // PENDING, ENROLLED, OFFLINE
|
|
lastHeartbeat DateTime?
|
|
uptime Int? // in seconds
|
|
temperature Float?
|
|
activeSlot String @default("A") // A or B
|
|
firmwareVersion String @default("1.0.0")
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
tests Test[]
|
|
}
|
|
|
|
model Test {
|
|
id String @id @default(cuid())
|
|
deviceId String
|
|
device Device @relation(fields: [deviceId], references: [id])
|
|
timestamp DateTime @default(now())
|
|
type String // HDMI_OFFLINE, HDMI_ONLINE
|
|
status String // PASS, FAIL, WARNING
|
|
hdmi5v Boolean
|
|
edid1080p Boolean?
|
|
edid4k120 Boolean?
|
|
diodeResults String? // JSON string of pin-by-pin results
|
|
rawOutput String? // Any extra log data from the device
|
|
summary String // Executive summary of the result
|
|
}
|