fix(aria): add BIGSERIAL PK to device_security_posture, fix JPA persist error
CD - Develop / build-and-deploy (push) Failing after 15m8s

V4 migration drops the device_id primary key and adds an auto-generated
id BIGSERIAL as the PK. device_id becomes a unique nullable column.
Agents that don't send a numeric deviceId can now save posture reports.
Controller GET /{deviceId} now uses findByDeviceId instead of findById.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 16:42:16 -04:00
parent c78289bfef
commit 1d6ccff529
4 changed files with 20 additions and 1 deletions
@@ -66,7 +66,7 @@ public class DevicePostureController {
@GetMapping("/{deviceId}")
@PreAuthorize("hasAnyRole('MSP_ADMIN','BCOS_ADMIN')")
public ResponseEntity<DeviceSecurityPosture> getPosture(@PathVariable Long deviceId) {
return postureRepository.findById(deviceId)
return postureRepository.findByDeviceId(deviceId)
.map(ResponseEntity::ok)
.orElse(ResponseEntity.notFound().build());
}