Skip to content

Commit 101b01d

Browse files
committed
Add runtime benchmark tables to SQLite
1 parent 3af3ba1 commit 101b01d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

database/src/pool/sqlite.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,26 @@ static MIGRATIONS: &[Migration] = &[
322322
),
323323
Migration::new("alter table benchmark add column category text not null default ''"),
324324
Migration::new("alter table pull_request_build add column commit_date timestamp"),
325+
Migration::new(
326+
r#"
327+
create table runtime_benchmark(
328+
name text primary key not null
329+
);
330+
create table runtime_pstat_series(
331+
id integer primary key not null,
332+
benchmark text not null references runtime_benchmark(name) on delete cascade on update cascade,
333+
metric text not null,
334+
UNIQUE(benchmark, metric)
335+
);
336+
create table runtime_pstat(
337+
series integer references runtime_pstat_series(id) on delete cascade on update cascade,
338+
aid integer references artifact(id) on delete cascade on update cascade,
339+
cid integer references collection(id) on delete cascade on update cascade,
340+
value double not null,
341+
PRIMARY KEY(series, aid, cid)
342+
);
343+
"#,
344+
),
325345
];
326346

327347
#[async_trait::async_trait]

0 commit comments

Comments
 (0)