Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/autopilot/services/autopilot-db-logger.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ export class AutopilotDbLoggerService {
}

const { challengeId = null, source, status = 'SUCCESS', details } = payload;
const logId = randomUUID();

// Explicitly cast generated UUID so Postgres columns typed as uuid accept the value.
const idFragment = Prisma.sql`CAST(${logId} AS uuid)`;
const detailsFragment =
details === undefined || details === null
? Prisma.sql`NULL`
Expand All @@ -70,7 +74,7 @@ export class AutopilotDbLoggerService {
"details",
"createdAt"
) VALUES (
${randomUUID()},
${idFragment},
${challengeId},
${action},
${status},
Expand Down