fix(scripts): add created_at timestamps to annotation import

Set created_at field for both span_label_types and span_annotations
to satisfy NOT NULL constraint
This commit is contained in:
Marko Djordjevic 2026-02-15 19:36:55 +01:00
parent a68a681c9b
commit 57240d4eea
2 changed files with 2338 additions and 0 deletions

View file

@ -95,6 +95,7 @@ async function ensureLabelTypes(labels: string[]): Promise<LabelTypeMap> {
hotkey: null, hotkey: null,
is_active: 1, is_active: 1,
sort_order: sortOrder++, sort_order: sortOrder++,
created_at: Math.floor(Date.now() / 1000),
}).returning(); }).returning();
labelMap[label] = { labelMap[label] = {
@ -144,6 +145,7 @@ async function importAnnotations(
color: labelInfo.color, color: labelInfo.color,
source: ann.source || 'programmatic', source: ann.source || 'programmatic',
model_prediction: null, model_prediction: null,
created_at: Math.floor(Date.now() / 1000),
}); });
imported++; imported++;

File diff suppressed because it is too large Load diff