summaryrefslogtreecommitdiff
path: root/database/schema.sql
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-08-08 13:06:05 +0300
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-08-08 13:06:05 +0300
commit081dea194ba8f63878735775416c12faa769b6b3 (patch)
tree0859be91671ae203a0495452825d8a477c1c1e4e /database/schema.sql
parentde280cce9c63aa95b1fda7d68bf5940db0ed6bcd (diff)
Add traceId foreign key to job model
Diffstat (limited to 'database/schema.sql')
-rw-r--r--database/schema.sql9
1 files changed, 7 insertions, 2 deletions
diff --git a/database/schema.sql b/database/schema.sql
index 858f5d47..6338a457 100644
--- a/database/schema.sql
+++ b/database/schema.sql
@@ -151,8 +151,13 @@ CREATE TABLE IF NOT EXISTS traces (
-- A job
CREATE TABLE IF NOT EXISTS jobs (
- id INTEGER PRIMARY KEY NOT NULL,
- name TEXT NOT NULL
+ id INTEGER PRIMARY KEY NOT NULL,
+ name TEXT NOT NULL,
+ trace_id INTEGER NOT NULL,
+
+ FOREIGN KEY (trace_id) REFERENCES traces (id)
+ ON DELETE CASCADE
+ ON UPDATE CASCADE
);
-- A task that's defined in terms of how many flops (floating point operations) it takes to complete