Skip to content

Commit

Permalink
fix: chat ingestion foreign key (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcrt authored Dec 27, 2024
1 parent 7c61541 commit a94b000
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions packages/backend/src/utils/ingest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,6 @@ export async function ingestChatEvent(
`;
} else if (operation === "update") {
update.endedAt = timestamp;
delete shared.id;
delete update.id;

await sql`
UPDATE run SET ${sql({ ...shared, ...update })} WHERE id = ${previousRun.id}
Expand Down
3 changes: 3 additions & 0 deletions packages/db/0055.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
alter table evaluation_result_v2
drop constraint evaluation_result_run_id_fkey,
add constraint evaluation_result_run_id_fkey foreign key (run_id) references public.run(id) on delete cascade on update cascade;

0 comments on commit a94b000

Please sign in to comment.