Skip to content

Commit 72c43eb

Browse files
committed
PR feedback; update schema.md & also update sqlite
1 parent 57f8b99 commit 72c43eb

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

database/schema.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,21 @@ bors_sha pr parent_sha complete requested include exclude runs commi
250250

251251
### error
252252

253-
Records a compilation or runtime error for an artifact and a benchmark.
253+
Records an error within the application namely a;
254+
- compilation
255+
- runtime
256+
- error contextual to a benchmark job
254257

255-
```
256-
sqlite> select * from error limit 1;
257-
aid benchmark error
258-
---------- --- -----
259-
1 syn-1.0.89 Failed to compile...
260-
```
258+
Columns:
259+
260+
* **id** (`BIGINT` / `SERIAL`): Primary key identifier for the job row;
261+
auto increments with each new job.
262+
* **aid** (`INTERGER`): References the artifact id column.
263+
* **context** (`TEXT NOT NULL`): A little message to be able to understand a
264+
bit more about why or where the error occured.
265+
* **message** (`TEXT NOT NULL`): The error message.
266+
* **job_id** (`INTEGER`): A nullable job_id which, if it exists it will inform
267+
us as to which job this error is part of.
261268

262269
## New benchmarking design
263270
We are currently implementing a new design for dispatching benchmarks to collector(s) and storing

database/src/pool/sqlite.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,9 @@ static MIGRATIONS: &[Migration] = &[
408408
),
409409
Migration::new(
410410
r#"
411-
CREATE TABLE IF NOT EXISTS error_new (
411+
CREATE TABLE error_new (
412412
id INTEGER PRIMARY KEY,
413-
aid INTEGER NOT NULL,
413+
aid INTEGER NOT NULL REFERENCES artifact(id) ON DELETE CASCADE ON UPDATE CASCADE,
414414
message TEXT NOT NULL,
415415
context TEXT NOT NULL,
416416
job_id INTEGER
@@ -428,7 +428,7 @@ static MIGRATIONS: &[Migration] = &[
428428
DROP TABLE error;
429429
ALTER TABLE error_new RENAME TO error;
430430
431-
CREATE INDEX IF NOT EXISTS error_artifact_idx ON error(aid);
431+
CREATE INDEX error_artifact_idx ON error(aid);
432432
"#,
433433
),
434434
];

0 commit comments

Comments
 (0)