From 3ac4a7fdc53f9d3ccef2ba710fc0268f15de6666 Mon Sep 17 00:00:00 2001 From: Owen Lin Date: Thu, 25 Jun 2026 15:49:58 -0700 Subject: [PATCH] update --- .../0001_thread_history.sql | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/codex-rs/state/thread_history_migrations/0001_thread_history.sql b/codex-rs/state/thread_history_migrations/0001_thread_history.sql index cdf1279119..c4d7646178 100644 --- a/codex-rs/state/thread_history_migrations/0001_thread_history.sql +++ b/codex-rs/state/thread_history_migrations/0001_thread_history.sql @@ -3,26 +3,23 @@ CREATE TABLE thread_turns ( thread_id TEXT NOT NULL, turn_created_at_ms INTEGER NOT NULL, metadata_json TEXT NOT NULL, - summary_first_user_item_key TEXT, - summary_final_agent_item_key TEXT + summary_first_user_item_id TEXT, + summary_final_agent_item_id TEXT ); CREATE INDEX idx_thread_turns_page ON thread_turns(thread_id, turn_created_at_ms, turn_id); CREATE TABLE thread_items ( + item_id TEXT PRIMARY KEY, thread_id TEXT NOT NULL, turn_id TEXT NOT NULL, - item_key TEXT NOT NULL, item_ordinal INTEGER NOT NULL, item_created_at_ms INTEGER NOT NULL, - item_type TEXT NOT NULL, - materialized_thread_item_json TEXT NOT NULL, - PRIMARY KEY (thread_id, turn_id, item_key), - UNIQUE (thread_id, item_ordinal) + materialized_thread_item_json TEXT NOT NULL ); -CREATE INDEX idx_thread_items_page +CREATE UNIQUE INDEX idx_thread_items_page ON thread_items(thread_id, item_ordinal); CREATE INDEX idx_thread_items_by_turn_page