import { v7 as uuidv7 } from "@aigne/uuid";
import { index, integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
export const ArchiveMetadata = sqliteTable("ArchiveMetadata", {
    id: text("id")
        .notNull()
        .primaryKey()
        .$defaultFn(() => uuidv7()),
    archiveFile: text("archiveFile").notNull().unique(),
    createdAt: integer("createdAt").notNull(),
    dateRangeStart: integer("dateRangeStart").notNull(),
    dateRangeEnd: integer("dateRangeEnd").notNull(),
    traceCount: integer("traceCount").notNull(),
    spanCount: integer("spanCount").notNull(),
    fileSize: integer("fileSize"),
    checksum: text("checksum"),
}, (table) => ({
    createdAtIdx: index("archive_metadata_created_at_idx").on(table.createdAt),
    archiveFileIdx: index("archive_metadata_archive_file_idx").on(table.archiveFile),
}));
