From aa97e067caae9cbe25fc9140fc3e625933615fb9 Mon Sep 17 00:00:00 2001
From: Georgios Andreadis <g.andreadis@student.tudelft.nl>
Date: Sat, 24 Mar 2018 11:55:45 +0100
Subject: feat: Add job id to DB schema

---
 database/schema.sql | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'database/schema.sql')

diff --git a/database/schema.sql b/database/schema.sql
index 3b751c30..b9460701 100644
--- a/database/schema.sql
+++ b/database/schema.sql
@@ -253,6 +253,7 @@ CREATE TABLE task_metrics (
   id            INTEGER PRIMARY KEY     NOT NULL AUTO_INCREMENT,
   experiment_id INTEGER                 NOT NULL,
   task_id       INTEGER                 NOT NULL,
+  job_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),
@@ -261,6 +262,9 @@ CREATE TABLE task_metrics (
     ON DELETE CASCADE
     ON UPDATE CASCADE,
   FOREIGN KEY (task_id) REFERENCES tasks (id)
+    ON DELETE CASCADE
+    ON UPDATE CASCADE,
+  FOREIGN KEY (job_id) REFERENCES jobs (id)
     ON DELETE CASCADE
     ON UPDATE CASCADE
 );
-- 
cgit v1.2.3

