Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions stovepipe/extension/storage/mysql/schema/request_history.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- request_history retains one append-only row per logical request occurrence. Exactly one of
-- state and event is populated; the remaining sparse columns carry the bounded context required
-- by that occurrence.
CREATE TABLE IF NOT EXISTS request_history (
queue VARCHAR(255) NOT NULL,
request_id VARCHAR(255) NOT NULL,
entry_id VARCHAR(255) NOT NULL,
timestamp_ms BIGINT NOT NULL,
state VARCHAR(64) NOT NULL DEFAULT '',
event VARCHAR(64) NOT NULL DEFAULT '',
request_version INT NOT NULL DEFAULT 0,
superseded_by_request_id VARCHAR(255) NOT NULL DEFAULT '',
build_id VARCHAR(255) NOT NULL DEFAULT '',
outcome_reason VARCHAR(64) NOT NULL DEFAULT '',
fact_degree DOUBLE NOT NULL DEFAULT 0,
PRIMARY KEY (queue, request_id, entry_id),
KEY idx_request_history_order (queue, request_id, timestamp_ms, entry_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func resetStorage(t *testing.T, db *sql.DB) {
t.Helper()

for _, statement := range []string{
"TRUNCATE TABLE request_history",
"TRUNCATE TABLE request_uri",
"TRUNCATE TABLE request",
"TRUNCATE TABLE build",
Expand Down
Loading