From b42e1548bc07df240d57bca6a5f5a0a5eea4bb29 Mon Sep 17 00:00:00 2001 From: Johannes Date: Mon, 15 Jun 2026 16:44:51 -0400 Subject: [PATCH] fix(aria): drop NOT NULL on device_id after PK migration V4 dropped the PK but PostgreSQL retained the implicit NOT NULL. V5 makes device_id nullable so agents without a numeric deviceId can persist posture reports. Co-Authored-By: Claude Sonnet 4.6 --- .../resources/db/migration/V5__posture_device_id_nullable.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/main/resources/db/migration/V5__posture_device_id_nullable.sql diff --git a/src/main/resources/db/migration/V5__posture_device_id_nullable.sql b/src/main/resources/db/migration/V5__posture_device_id_nullable.sql new file mode 100644 index 0000000..7b543fd --- /dev/null +++ b/src/main/resources/db/migration/V5__posture_device_id_nullable.sql @@ -0,0 +1,3 @@ +-- device_id retained its NOT NULL constraint after the PK was dropped in V4. +-- Make it nullable so agents that don't send a numeric deviceId can persist. +ALTER TABLE device_security_posture ALTER COLUMN device_id DROP NOT NULL;