DROP TABLE `graph_insights`;--> statement-breakpoint
DROP TABLE `graph_summaries`;--> statement-breakpoint
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,
	`attention` text NOT NULL,
	`signatureChanged` integer NOT NULL,
	`reachesEntryPoint` integer NOT NULL,
	`dependentsJson` 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 INDEX `graph_insight_run_id_idx` ON `graph_insights` (`runId`);--> statement-breakpoint
CREATE TABLE `graph_summaries` (
	`runId` text PRIMARY KEY NOT NULL,
	`risk` text NOT NULL,
	`attentionCount` integer NOT NULL,
	`totalNotUpdatedDependentFiles` integer NOT NULL,
	`changedSymbolCount` integer NOT NULL,
	`edgesJson` text NOT NULL,
	FOREIGN KEY (`runId`) REFERENCES `chapter_run`(`id`) ON UPDATE no action ON DELETE cascade
);
