CREATE TABLE `graph_insights` (
	`id` text PRIMARY KEY NOT NULL,
	`createdAt` integer NOT NULL,
	`updatedAt` integer NOT NULL,
	`runId` text NOT NULL,
	`name` text NOT NULL,
	`kind` text NOT NULL,
	`filePath` text NOT NULL,
	`startLine` integer NOT NULL,
	`endLine` integer NOT NULL,
	`externalCallerCount` integer NOT NULL,
	`callersJson` text NOT NULL,
	`entryPathsJson` text NOT NULL,
	`calleesJson` text NOT NULL,
	FOREIGN KEY (`runId`) REFERENCES `chapter_run`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `graph_summaries` (
	`runId` text PRIMARY KEY NOT NULL,
	`risk` text NOT NULL,
	`totalExternalCallers` integer NOT NULL,
	`changedSymbolCount` integer NOT NULL,
	FOREIGN KEY (`runId`) REFERENCES `chapter_run`(`id`) ON UPDATE no action ON DELETE cascade
);
