Switch to side-by-side view

--- a/DB/creation.sql
+++ b/DB/creation.sql
@@ -4,7 +4,7 @@
 --
 -- Host: 192.168.0.159    Database: notifications
 -- ------------------------------------------------------
--- Server version	5.7.21-log
+-- Server version 5.7.21-log
 
 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -25,15 +25,16 @@
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
 CREATE TABLE `notificationlist` (
-  `notificationID` int(11) NOT NULL AUTO_INCREMENT,
-  `emailTo` varchar(100) NOT NULL,
+  `notificationID` int(10) NOT NULL AUTO_INCREMENT,
   `subject` varchar(100) NOT NULL,
   `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `token` varchar(100) NOT NULL,
-  `ntype` int(5) NOT NULL,
+  `rulesID` int(20) NOT NULL,
   PRIMARY KEY (`notificationID`),
   KEY `token` (`token`),
-  CONSTRAINT `notificationlist_ibfk_1` FOREIGN KEY (`token`) REFERENCES `registration` (`token`)
+  CONSTRAINT `notificationlist_ibfk_1_idx` FOREIGN KEY (`token`) REFERENCES `registration` (`token`)  ON DELETE CASCADE ON UPDATE NO ACTION,
+  KEY `rulesID` (`rulesID`),
+  CONSTRAINT `notificationlist_ibfk_2_idx` FOREIGN KEY (`rulesID`) REFERENCES `ruleslist` (`rulesID`) ON DELETE CASCADE ON UPDATE NO ACTION
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 /*!40101 SET character_set_client = @saved_cs_client */;
 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -62,17 +63,24 @@
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
 CREATE TABLE `ruleslist` (
-  `rulesID` int(11) NOT NULL AUTO_INCREMENT,
+  `rulesID` int(20) NOT NULL AUTO_INCREMENT,
   `description` varchar(100) NOT NULL,
-  `parameter` varchar(300) NOT NULL,
+  `parameter` varchar(100) NOT NULL,
   `conditionValue` varchar(50) NOT NULL,
   `controlValue` varchar(50) NOT NULL,
-  `notificationType` int(5) NOT NULL,
+  `threshold` varchar(5) NOT NULL,
+  `notifyType` varchar(20) NOT NULL,
+  `emailTo` varchar(100) NOT NULL,
+  `notificationType` int(1) NOT NULL,
+  `hostname` varchar(10) NOT NULL,
+  `port` int(5) NOT NULL,
+  `path` varchar(10) NOT NULL,
+  `method` varchar(10) NOT NULL,
   `token` varchar(100) NOT NULL,
   PRIMARY KEY (`rulesID`),
   KEY `token` (`token`),
-  CONSTRAINT `ruleslist_ibfk_1` FOREIGN KEY (`token`) REFERENCES `registration` (`token`)
-) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
+  CONSTRAINT `ruleslist_ibfk_1_idx` FOREIGN KEY (`token`) REFERENCES `registration` (`token`)  ON DELETE CASCADE ON UPDATE NO ACTION
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 /*!40101 SET character_set_client = @saved_cs_client */;
 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
 
@@ -91,14 +99,10 @@
   `subject` varchar(50) NOT NULL,
   `rulesID` int(11) NOT NULL,
   PRIMARY KEY (`statisticsID`),
-  KEY `ruleslist_ibfk_1_idx` (`rulesID`),
-  CONSTRAINT `` FOREIGN KEY (`rulesID`) REFERENCES `ruleslist` (`rulesID`) ON DELETE CASCADE ON UPDATE NO ACTION
+  KEY `rulesID` (`rulesID`),
+  CONSTRAINT `statisticslist_ibfk_1_idx` FOREIGN KEY (`rulesID`) REFERENCES `ruleslist` (`rulesID`) ON DELETE CASCADE ON UPDATE NO ACTION
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 /*!40101 SET character_set_client = @saved_cs_client */;
-/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
-
-
-
 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
 
 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;