-- Migration: Add agent_log_chunks table for DB-first agent output persistence
-- Chunks survive agent deletion (no FK to agents table)

CREATE TABLE `agent_log_chunks` (
	`id` text PRIMARY KEY NOT NULL,
	`agent_id` text NOT NULL,
	`agent_name` text NOT NULL,
	`session_number` integer DEFAULT 1 NOT NULL,
	`content` text NOT NULL,
	`created_at` integer NOT NULL
);--> statement-breakpoint
CREATE INDEX `agent_log_chunks_agent_id_idx` ON `agent_log_chunks` (`agent_id`);
