fix: correct timestamp/boolean types for PostgreSQL schema (Date not int, bool not 0/1)

This commit is contained in:
Marko Djordjevic 2026-02-17 22:50:31 +01:00
parent e00bd4d804
commit 69634909d1
9 changed files with 75 additions and 131 deletions

View file

@ -93,9 +93,9 @@ async function ensureLabelTypes(labels: string[]): Promise<LabelTypeMap> {
display_name: label,
color,
hotkey: null,
is_active: 1,
is_active: true,
sort_order: sortOrder++,
created_at: Math.floor(Date.now() / 1000),
created_at: new Date(),
}).returning();
labelMap[label] = {
@ -135,8 +135,8 @@ async function importAnnotations(
try {
await db.insert(spanAnnotations).values({
chart_id: chartId,
start_time: ann.start_time,
end_time: ann.end_time,
start_time: new Date(ann.start_time * 1000),
end_time: new Date(ann.end_time * 1000),
label: ann.label,
confidence: ann.confidence || null,
outcome: null,
@ -145,7 +145,7 @@ async function importAnnotations(
color: labelInfo.color,
source: ann.source || 'programmatic',
model_prediction: null,
created_at: Math.floor(Date.now() / 1000),
created_at: new Date(),
});
imported++;