pr_01m47d15m3e54sn21z27rpy5n9/services/work/migrations/0001_init.sql
Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Initial g1t: services, event bus, intents and attempts | 1 | CREATE TABLE intents ( |
| 2 | id TEXT PRIMARY KEY, | |
| 3 | repo_id TEXT NOT NULL, | |
| 4 | number INTEGER NOT NULL, | |
| 5 | title TEXT NOT NULL, | |
| 6 | brief TEXT NOT NULL, | |
| 7 | -- JSON array of commands. | |
| 8 | checks TEXT NOT NULL DEFAULT '[]', | |
| 9 | status TEXT NOT NULL DEFAULT 'open', | |
| 10 | author_id TEXT NOT NULL, | |
| 11 | author_name TEXT NOT NULL, | |
| 12 | created_at INTEGER NOT NULL, | |
| 13 | UNIQUE (repo_id, number) | |
| 14 | ); | |
| 15 | ||
| 16 | CREATE TABLE attempts ( | |
| 17 | id TEXT PRIMARY KEY, | |
| 18 | intent_id TEXT NOT NULL REFERENCES intents (id), | |
| 19 | repo_id TEXT NOT NULL, | |
| 20 | number INTEGER NOT NULL, | |
| 21 | agent TEXT NOT NULL, | |
| 22 | runtime TEXT NOT NULL, | |
| 23 | status TEXT NOT NULL DEFAULT 'working', | |
| 24 | summary TEXT, | |
| 25 | fork_repo_id TEXT NOT NULL UNIQUE, | |
| 26 | fork_namespace TEXT NOT NULL, | |
| 27 | fork_name TEXT NOT NULL, | |
| 28 | head_commit TEXT, | |
| 29 | started_by_id TEXT NOT NULL, | |
| 30 | started_by_name TEXT NOT NULL, | |
| 31 | created_at INTEGER NOT NULL, | |
| 32 | updated_at INTEGER NOT NULL, | |
| 33 | UNIQUE (intent_id, number) | |
| 34 | ); | |
| 35 | CREATE INDEX attempts_starter ON attempts (started_by_id, status); | |
| 36 | ||
| 37 | CREATE TABLE session_entries ( | |
| 38 | attempt_id TEXT NOT NULL REFERENCES attempts (id), | |
| 39 | seq INTEGER NOT NULL, | |
| 40 | kind TEXT NOT NULL, | |
| 41 | text TEXT NOT NULL, | |
| 42 | tool TEXT, | |
| 43 | -- The fork's head when the entry was recorded: links reasoning to code. | |
| 44 | "commit" TEXT, | |
| 45 | at INTEGER NOT NULL, | |
| 46 | PRIMARY KEY (attempt_id, seq) | |
| 47 | ); |