CREATE TABLE `note_edits` (
	`id` text PRIMARY KEY NOT NULL,
	`note_id` text NOT NULL,
	`type` text NOT NULL,
	`anchor_before` text,
	`anchor_text` text,
	`proposed_content` text NOT NULL,
	`status` text DEFAULT 'pending' NOT NULL,
	`agent_id` text,
	`run_id` text,
	`reasoning` text,
	`created_at` integer NOT NULL,
	`resolved_at` integer
);
--> statement-breakpoint
ALTER TABLE `notes` ADD `ai_summary` text;--> statement-breakpoint
ALTER TABLE `notes` ADD `ai_summary_updated_at` integer;