skillguard/lib/db/src/schema/scanFiles.ts

17 lines
572 B
TypeScript
Raw Normal View History

import { pgTable, serial, text, integer } from "drizzle-orm/pg-core";
import { scansTable } from "./scans";
export const scanFilesTable = pgTable("scan_files", {
id: serial("id").primaryKey(),
scanId: integer("scan_id")
.notNull()
.references(() => scansTable.id, { onDelete: "cascade" }),
path: text("path").notNull(),
kind: text("kind").notNull(),
language: text("language"),
size: integer("size").notNull().default(0),
});
export type ScanFile = typeof scanFilesTable.$inferSelect;
export type InsertScanFile = typeof scanFilesTable.$inferInsert;