feat(mdm): add NanoMDM health columns migration for UserDevice
Adds mdm_id, mdm_enrolled, mdm_supervised, mdm_last_seen_at and an index on mdm_id. Uses IF NOT EXISTS to stay idempotent because mdm_id was added manually before the migration was created.
This commit is contained in:
parent
9065543b5a
commit
b107262d60
@ -0,0 +1,11 @@
|
||||
-- Spiegel-Spalten für NanoMDM Enrollment/Supervision-Status auf UserDevice.
|
||||
-- mdm_id wurde manuell hinzugefügt; IF NOT EXISTS macht die Migration idempotent.
|
||||
|
||||
ALTER TABLE "rebreak"."user_devices"
|
||||
ADD COLUMN IF NOT EXISTS "mdm_id" TEXT,
|
||||
ADD COLUMN IF NOT EXISTS "mdm_enrolled" BOOLEAN,
|
||||
ADD COLUMN IF NOT EXISTS "mdm_supervised" BOOLEAN,
|
||||
ADD COLUMN IF NOT EXISTS "mdm_last_seen_at" TIMESTAMPTZ(6);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS "user_devices_mdm_id_idx"
|
||||
ON "rebreak"."user_devices"("mdm_id");
|
||||
@ -1123,6 +1123,7 @@ model UserDevice {
|
||||
@@unique([userId, deviceId])
|
||||
@@index([userId])
|
||||
@@index([deviceId])
|
||||
@@index([mdmId])
|
||||
@@map("user_devices")
|
||||
@@schema("rebreak")
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user