From 9065543b5a7c2242536baeff3afe3252a0f1dfc6 Mon Sep 17 00:00:00 2001 From: chahinebrini Date: Thu, 18 Jun 2026 03:11:50 +0200 Subject: [PATCH] feat(backend): extend UserDevice with MDM health columns Add mirrored NanoMDM enrollment, supervision and last-seen fields (mdm_enrolled, mdm_supervised, mdm_last_seen_at) to UserDevice model. Migration will follow in a separate task. --- backend/prisma/schema.prisma | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/prisma/schema.prisma b/backend/prisma/schema.prisma index ef292c9..b4f1673 100644 --- a/backend/prisma/schema.prisma +++ b/backend/prisma/schema.prisma @@ -1113,6 +1113,13 @@ model UserDevice { /// NULL → Gerät ist nicht mit einem MDM-UDID verknüpft. mdmId String? @map("mdm_id") + /// Gespiegelter Enrollment-Status aus NanoMDM enrollments.enabled. + mdmEnrolled Boolean? @map("mdm_enrolled") + /// Gespiegelter Supervision-Status aus NanoMDM devices.unlock_token IS NOT NULL. + mdmSupervised Boolean? @map("mdm_supervised") + /// Letzter NanoMDM Check-In (enrollments.last_seen_at). + mdmLastSeenAt DateTime? @map("mdm_last_seen_at") + @@unique([userId, deviceId]) @@index([userId]) @@index([deviceId])