CREATE TABLE `review_job` (
	`id` text PRIMARY KEY NOT NULL,
	`createdAt` integer NOT NULL,
	`updatedAt` integer NOT NULL,
	`status` text DEFAULT 'queued' NOT NULL,
	`baseRef` text NOT NULL,
	`compareRef` text NOT NULL,
	`mrUrl` text,
	`intent` text,
	`runId` text,
	`error` text,
	`logPath` text NOT NULL,
	`startedAt` integer,
	`finishedAt` integer,
	FOREIGN KEY (`runId`) REFERENCES `chapter_run`(`id`) ON UPDATE no action ON DELETE set null
);
--> statement-breakpoint
CREATE INDEX `review_job_created_at_idx` ON `review_job` (`createdAt`);