diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2018-03-12 07:33:59 +0100 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2018-08-14 19:15:20 +0200 |
| commit | 1ccc68defdb1f67f39dc836ee6659a89135c038c (patch) | |
| tree | 6307e254a427ac341d3859ecf98feccf8623e867 /database | |
| parent | d8f5e2a7270a6aed04dac17048c6ef7229d3caab (diff) | |
feat: Add task metrics to DB schema
Diffstat (limited to 'database')
| -rw-r--r-- | database/schema.sql | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/database/schema.sql b/database/schema.sql index 9e356b4a..3b751c30 100644 --- a/database/schema.sql +++ b/database/schema.sql @@ -233,6 +233,7 @@ CREATE TABLE task_states ( ); -- The measurements of a single stage +DROP TABLE IF EXISTS stage_measurements; CREATE TABLE stage_measurements ( id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT, experiment_id INTEGER NOT NULL, @@ -246,6 +247,24 @@ CREATE TABLE stage_measurements ( ON UPDATE CASCADE ); +-- Metrics of a single task +DROP TABLE IF EXISTS task_metrics; +CREATE TABLE task_metrics ( + id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT, + experiment_id INTEGER NOT NULL, + task_id INTEGER NOT NULL, + waiting INTEGER NOT NULL CHECK (waiting >= 0), + execution INTEGER NOT NULL CHECK (execution >= 0), + turnaround INTEGER NOT NULL CHECK (turnaround >= 0), + + FOREIGN KEY (experiment_id) REFERENCES experiments (id) + ON DELETE CASCADE + ON UPDATE CASCADE, + FOREIGN KEY (task_id) REFERENCES tasks (id) + ON DELETE CASCADE + ON UPDATE CASCADE +); + -- A machine state DROP TABLE IF EXISTS machine_states; CREATE TABLE machine_states ( |
