import { sqliteTable, text, integer, real } from "drizzle-orm/sqlite-core"; export const skills = sqliteTable("skills", { id: text("id").primaryKey(), sourceId: text("source_id").notNull(), name: text("name").notNull(), description: text("description"), sourceUrl: text("source_url"), activeVersionId: text("active_version_id"), removedAt: integer("removed_at"), // unix ms, nullable — soft-delete createdAt: integer("created_at").notNull(), updatedAt: integer("updated_at").notNull(), }); export const skillVersions = sqliteTable("skill_versions", { id: text("id").primaryKey(), skillId: text("skill_id").notNull(), version: text("version").notNull(), fetchedAt: integer("fetched_at").notNull(), cacheDir: text("cache_dir"), }); export const skillFiles = sqliteTable("skill_files", { id: text("id").primaryKey(), versionId: text("version_id").notNull(), path: text("path").notNull(), kind: text("kind").notNull(), // "skill" | "reference" | "script" | "asset" sizeBytes: integer("size_bytes"), }); export const communityRatings = sqliteTable("community_ratings", { id: text("id").primaryKey(), skillId: text("skill_id").notNull(), fetchedAt: integer("fetched_at").notNull(), averageRating: real("average_rating"), ratingCount: integer("rating_count"), source: text("source"), });