From 42930782f5dc6ee5efae9cc8148f3a3d3eb67dc8 Mon Sep 17 00:00:00 2001
From: Georgios Andreadis <g.andreadis@student.tudelft.nl>
Date: Sat, 30 Sep 2017 12:35:23 +0200
Subject: Fix foreign key constraint on experiment states

---
 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 644fbd53..7f0d5879 100644
--- a/database/schema.sql
+++ b/database/schema.sql
@@ -208,6 +208,8 @@ CREATE TABLE task_states (
 
   FOREIGN KEY (task_id) REFERENCES tasks (id),
   FOREIGN KEY (experiment_id) REFERENCES experiments (id)
+    ON DELETE CASCADE
+    ON UPDATE CASCADE
 );
 
 -- A machine state
@@ -227,6 +229,8 @@ CREATE TABLE machine_states (
     ON DELETE CASCADE
     ON UPDATE CASCADE,
   FOREIGN KEY (experiment_id) REFERENCES experiments (id)
+    ON DELETE CASCADE
+    ON UPDATE CASCADE
 );
 
 /*
-- 
cgit v1.2.3

