feat: Initialize Next.js project with Prisma, Tailwind CSS, and API routes for device management and testing.
This commit is contained in:
42
prisma/schema.prisma
Normal file
42
prisma/schema.prisma
Normal file
@@ -0,0 +1,42 @@
|
||||
// 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
|
||||
}
|
||||
Reference in New Issue
Block a user