-- MySQL dump 10.13  Distrib 5.7.12, for Win64 (x86_64)
--
-- Host: localhost    Database: project_final_rev
-- ------------------------------------------------------
-- Server version	5.7.17-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `input`
--

DROP TABLE IF EXISTS `input`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `input` (
  `ID_INPUT` int(11) NOT NULL AUTO_INCREMENT,
  `TEMP_SET` float DEFAULT NULL,
  `AUTOMATIC_SET` int(11) DEFAULT NULL,
  `ELEMENT_POWER_SET` int(11) DEFAULT NULL,
  `ELEMENT_HEAT_COOL_SET` int(11) DEFAULT NULL,
  PRIMARY KEY (`ID_INPUT`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `input`
--

LOCK TABLES `input` WRITE;
/*!40000 ALTER TABLE `input` DISABLE KEYS */;
INSERT INTO `input` VALUES (1,25,0,1,1),(2,25,0,1,1);
/*!40000 ALTER TABLE `input` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `measurement`
--

DROP TABLE IF EXISTS `measurement`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `measurement` (
  `ID_MEASUREMENT` int(11) NOT NULL AUTO_INCREMENT,
  `ID_SENSOR` int(11) DEFAULT NULL,
  `TEMPERATURE` float DEFAULT NULL,
  `DATE_TIME` varchar(45) DEFAULT NULL,
  `SET_TEMPERATURE` float DEFAULT NULL,
  PRIMARY KEY (`ID_MEASUREMENT`),
  KEY `ID_SENSOR_idx` (`ID_SENSOR`),
  CONSTRAINT `ID_SENSOR` FOREIGN KEY (`ID_SENSOR`) REFERENCES `sensors` (`ID_SENSOR`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `measurement`
--

LOCK TABLES `measurement` WRITE;
/*!40000 ALTER TABLE `measurement` DISABLE KEYS */;
/*!40000 ALTER TABLE `measurement` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `micontrol`
--

DROP TABLE IF EXISTS `micontrol`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `micontrol` (
  `ID_MICONTROL` int(11) NOT NULL,
  `ID_MEASUREMENT` int(11) DEFAULT NULL,
  `ID_PELTIER_STATUS` int(11) DEFAULT NULL,
  `ID_PUMP_STATUS` int(11) DEFAULT NULL,
  PRIMARY KEY (`ID_MICONTROL`),
  KEY `ID_MEASUREMENT_idx` (`ID_MEASUREMENT`),
  KEY `ID_PELTIER_idx` (`ID_PELTIER_STATUS`),
  KEY `ID_PUMP_STATUS_idx` (`ID_PUMP_STATUS`),
  CONSTRAINT `ID_MEASUREMENT` FOREIGN KEY (`ID_MEASUREMENT`) REFERENCES `measurement` (`ID_MEASUREMENT`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `ID_PELTIER` FOREIGN KEY (`ID_PELTIER_STATUS`) REFERENCES `peltier_status` (`ID_PELTIER_STATUS`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `ID_PUMP_STATUS` FOREIGN KEY (`ID_PUMP_STATUS`) REFERENCES `pump_status` (`ID_PUMP_STATUS`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `micontrol`
--

LOCK TABLES `micontrol` WRITE;
/*!40000 ALTER TABLE `micontrol` DISABLE KEYS */;
/*!40000 ALTER TABLE `micontrol` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `peltier_status`
--

DROP TABLE IF EXISTS `peltier_status`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `peltier_status` (
  `ID_PELTIER_STATUS` int(11) NOT NULL AUTO_INCREMENT,
  `STATUS` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`ID_PELTIER_STATUS`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `peltier_status`
--

LOCK TABLES `peltier_status` WRITE;
/*!40000 ALTER TABLE `peltier_status` DISABLE KEYS */;
INSERT INTO `peltier_status` VALUES (1,'HEATING'),(2,'COOLING'),(3,'OFF');
/*!40000 ALTER TABLE `peltier_status` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pump_status`
--

DROP TABLE IF EXISTS `pump_status`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pump_status` (
  `ID_PUMP_STATUS` int(11) NOT NULL AUTO_INCREMENT,
  `STATUS` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`ID_PUMP_STATUS`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pump_status`
--

LOCK TABLES `pump_status` WRITE;
/*!40000 ALTER TABLE `pump_status` DISABLE KEYS */;
INSERT INTO `pump_status` VALUES (1,'ON'),(2,'OFF');
/*!40000 ALTER TABLE `pump_status` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sensors`
--

DROP TABLE IF EXISTS `sensors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sensors` (
  `ID_SENSOR` int(11) NOT NULL AUTO_INCREMENT,
  `SENSOR_ADDRESS` varchar(45) DEFAULT NULL,
  `SENSOR_TYPE` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`ID_SENSOR`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `sensors`
--

LOCK TABLES `sensors` WRITE;
/*!40000 ALTER TABLE `sensors` DISABLE KEYS */;
INSERT INTO `sensors` VALUES (1,'28-0516a2d372ff','Temperature sensor'),(2,'28-0316a2ed4eff','Temperature sensor'),(3,'28-0316a2d7aeff','Temperature sensor'),(4,'28-0516a2e15dff','Temperature sensor');
/*!40000 ALTER TABLE `sensors` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2017-06-10 20:46:19
