mirror of
https://github.com/openai/codex.git
synced 2026-09-07 15:40:00 +00:00
## What changed - Add a `thread_artifacts` SQLite table with per-thread typed identities, JSON payloads, cascade deletion, uniqueness enforcement, and an index for ordered per-thread reads. - Export artifact records, attachment and removal outcomes, and paginated result models from `codex-state`. ## Testing - Add a migration test covering preservation of existing thread-section metadata and compatibility with the previous migration set. GitOrigin-RevId: 4e0a8e5bfa168ae2b8871970466e5055e142a4a6
13 lines
412 B
SQL
13 lines
412 B
SQL
CREATE TABLE thread_artifacts (
|
|
id TEXT PRIMARY KEY,
|
|
thread_id TEXT NOT NULL REFERENCES threads(id) ON DELETE CASCADE,
|
|
artifact_type TEXT NOT NULL,
|
|
identity_key TEXT NOT NULL,
|
|
payload TEXT NOT NULL,
|
|
created_at INTEGER NOT NULL,
|
|
UNIQUE (thread_id, artifact_type, identity_key)
|
|
);
|
|
|
|
CREATE INDEX idx_thread_artifacts_thread_created_id
|
|
ON thread_artifacts(thread_id, created_at, id);
|