-- MariaDB dump 10.17  Distrib 10.4.11-MariaDB, for Win64 (AMD64)
--
-- Host: localhost    Database: marathon_release
-- ------------------------------------------------------
-- Server version	10.4.11-MariaDB

/*!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 utf8mb4 */;
/*!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 `current`
--

DROP TABLE IF EXISTS `current`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `current` (
  `id` int(11) DEFAULT NULL,
  `ip` varchar(30) DEFAULT NULL,
  KEY `id` (`id`),
  CONSTRAINT `current_ibfk_1` FOREIGN KEY (`id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `current`
--

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

--
-- Table structure for table `estate_types`
--

DROP TABLE IF EXISTS `estate_types`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `estate_types` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(127) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `estate_types`
--

LOCK TABLES `estate_types` WRITE;
/*!40000 ALTER TABLE `estate_types` DISABLE KEYS */;
INSERT INTO `estate_types` VALUES (2,'Office'),(3,'District heating'),(4,'Domestic (free running)'),(5,'Domestic (mechanically cooled)');
/*!40000 ALTER TABLE `estate_types` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `estates`
--

DROP TABLE IF EXISTS `estates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `estates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(240) DEFAULT NULL,
  `owners` varchar(240) DEFAULT NULL,
  `portal_site_id` varchar(96) DEFAULT NULL,
  `type` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `type` (`type`),
  CONSTRAINT `estates_ibfk_1` FOREIGN KEY (`type`) REFERENCES `estate_types` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `estates`
--

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

--
-- Table structure for table `model_inputs`
--

DROP TABLE IF EXISTS `model_inputs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `model_inputs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `model` int(11) DEFAULT NULL,
  `result` int(11) DEFAULT NULL,
  `in01` varchar(20) DEFAULT NULL,
  `in02` varchar(20) DEFAULT NULL,
  `in03` varchar(20) DEFAULT NULL,
  `in04` varchar(20) DEFAULT NULL,
  `in05` varchar(20) DEFAULT NULL,
  `in06` varchar(20) DEFAULT NULL,
  `in07` varchar(20) DEFAULT NULL,
  `in08` varchar(20) DEFAULT NULL,
  `in09` varchar(20) DEFAULT NULL,
  `in10` varchar(20) DEFAULT NULL,
  `in11` varchar(20) DEFAULT NULL,
  `in12` varchar(20) DEFAULT NULL,
  `in13` varchar(20) DEFAULT NULL,
  `in14` varchar(20) DEFAULT NULL,
  `in15` varchar(20) DEFAULT NULL,
  `in16` varchar(20) DEFAULT NULL,
  `in17` varchar(20) DEFAULT NULL,
  `in18` varchar(20) DEFAULT NULL,
  `in19` varchar(20) DEFAULT NULL,
  `in20` varchar(20) DEFAULT NULL,
  `in21` varchar(20) DEFAULT NULL,
  `in22` varchar(20) DEFAULT NULL,
  `in23` varchar(20) DEFAULT NULL,
  `in24` varchar(20) DEFAULT NULL,
  `in25` varchar(20) DEFAULT NULL,
  `in26` varchar(20) DEFAULT NULL,
  `in27` varchar(20) DEFAULT NULL,
  `in28` varchar(20) DEFAULT NULL,
  `in29` varchar(20) DEFAULT NULL,
  `in30` varchar(20) DEFAULT NULL,
  `name` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `model` (`model`),
  KEY `result` (`result`),
  CONSTRAINT `model_inputs_ibfk_1` FOREIGN KEY (`model`) REFERENCES `models` (`id`),
  CONSTRAINT `model_inputs_ibfk_2` FOREIGN KEY (`result`) REFERENCES `results` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=84 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `model_inputs`
--

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

--
-- Table structure for table `models`
--

DROP TABLE IF EXISTS `models`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `models` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(240) DEFAULT NULL,
  `estate` int(11) NOT NULL,
  `tarball` varchar(240) DEFAULT NULL,
  `created` varchar(30) DEFAULT NULL,
  `author` varchar(240) DEFAULT NULL,
  `purpose` varchar(480) DEFAULT NULL,
  `md5` varchar(248) DEFAULT NULL,
  `preset` int(11) DEFAULT NULL,
  `portal_model_id` varchar(96) DEFAULT NULL,
  `portal_building_id` varchar(96) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `estate` (`estate`),
  CONSTRAINT `models_ibfk_1` FOREIGN KEY (`estate`) REFERENCES `estates` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=131 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `models`
--

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

--
-- Table structure for table `presets`
--

DROP TABLE IF EXISTS `presets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `presets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) DEFAULT NULL,
  `estate_type` int(11) NOT NULL,
  `is_custom` int(11) DEFAULT NULL,
  `in01` varchar(20) DEFAULT NULL,
  `in02` varchar(20) DEFAULT NULL,
  `in03` varchar(20) DEFAULT NULL,
  `in04` varchar(20) DEFAULT NULL,
  `in05` varchar(20) DEFAULT NULL,
  `in06` varchar(20) DEFAULT NULL,
  `in07` varchar(20) DEFAULT NULL,
  `in08` varchar(20) DEFAULT NULL,
  `in09` varchar(20) DEFAULT NULL,
  `in10` varchar(20) DEFAULT NULL,
  `in11` varchar(20) DEFAULT NULL,
  `in12` varchar(20) DEFAULT NULL,
  `in13` varchar(20) DEFAULT NULL,
  `in14` varchar(20) DEFAULT NULL,
  `in15` varchar(20) DEFAULT NULL,
  `in16` varchar(20) DEFAULT NULL,
  `in17` varchar(20) DEFAULT NULL,
  `in18` varchar(20) DEFAULT NULL,
  `in19` varchar(20) DEFAULT NULL,
  `in20` varchar(20) DEFAULT NULL,
  `in21` varchar(20) DEFAULT NULL,
  `in22` varchar(20) DEFAULT NULL,
  `in23` varchar(20) DEFAULT NULL,
  `in24` varchar(20) DEFAULT NULL,
  `in25` varchar(20) DEFAULT NULL,
  `in26` varchar(20) DEFAULT NULL,
  `in27` varchar(20) DEFAULT NULL,
  `in28` varchar(20) DEFAULT NULL,
  `in29` varchar(20) DEFAULT NULL,
  `in30` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `presets`
--

LOCK TABLES `presets` WRITE;
/*!40000 ALTER TABLE `presets` DISABLE KEYS */;
INSERT INTO `presets` VALUES (1,'custom',4,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,'regulations compliance',4,0,'30',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'CIBSE TM52','22','CIBSE TM52','17','CIBSE TM52','17','CIBSE TM52','20','CIBSE TM52','19','CIBSE TM52','19','approved document F','l/ s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,'custom',5,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,'regulations compliance',5,0,'30',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'CIBSE TM52','22','CIBSE TM52','17','CIBSE TM52','17','CIBSE TM52','20','CIBSE TM52','19','CIBSE TM52','19','approved document F','l/ s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(6,'custom',2,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(7,'regulations compliance',2,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'25','21','approved document F','l/ s','1000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(8,'custom',3,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(9,'regulations compliance',3,0,'86','15','40',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `presets` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `results`
--

DROP TABLE IF EXISTS `results`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `results` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `model` int(11) DEFAULT NULL,
  `result` int(11) DEFAULT NULL,
  `requested_at` varchar(20) DEFAULT NULL,
  `portal_result_id` varchar(96) DEFAULT NULL,
  `name` varchar(60) DEFAULT NULL,
  `preset` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `model` (`model`),
  CONSTRAINT `results_ibfk_1` FOREIGN KEY (`model`) REFERENCES `models` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=542 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `results`
--

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

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_type` int(11) DEFAULT NULL,
  `name` varchar(240) DEFAULT NULL,
  `email` varchar(240) DEFAULT NULL,
  `password` varchar(48) DEFAULT NULL,
  `latest_estate` int(11) DEFAULT NULL,
  `latest_model` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `users`
--

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
/*!40000 ALTER TABLE `users` 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 2020-09-17 15:34:37
