--
-- Host: localhost    Database: solodb_init_database
-- ------------------------------------------------------


--
-- Table structure for table `admin_api_log`
--

CREATE TABLE `admin_api_log` (
  `id` int NOT NULL AUTO_INCREMENT,
  `class` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` smallint NOT NULL,
  `dateCreated` datetime NOT NULL,
  `payload` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `statusCode` int NOT NULL,
  `status` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `response` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_api_log`
--


--
-- Table structure for table `admin_log`
--

CREATE TABLE `admin_log` (
  `id` int NOT NULL AUTO_INCREMENT,
  `date` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` int NOT NULL,
  `event` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `url` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `file` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `line` int NOT NULL,
  `error_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `trace` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `request_data` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_log`
--

INSERT INTO `admin_log` VALUES (1,'2022-12-25 13:52:07',3,'You are not authorized to access zfcadmin/role/list','https://demo.solodb.net/admin/role/list.html','/var/www/solodb.demo/vendor/kokspflanze/bjy-authorize/src/Guard/Route.php',69,'BjyAuthorize\\Exception\\UnAuthorizedException','#0 /var/www/solodb.demo/vendor/laminas/laminas-eventmanager/src/EventManager.php(318): BjyAuthorize\\Guard\\Route->onRoute()\n#1 /var/www/solodb.demo/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\\EventManager\\EventManager->triggerListeners()\n#2 /var/www/solodb.demo/vendor/laminas/laminas-mvc/src/Application.php(298): Laminas\\EventManager\\EventManager->triggerEventUntil()\n#3 /var/www/solodb.demo/public/index.php(26): Laminas\\Mvc\\Application->run()\n#4 {main}','array (\n  \'request_method\' => \'GET\',\n  \'query_data\' => \n  array (\n  ),\n  \'body_data\' => \n  array (\n  ),\n  \'raw_data\' => \'\',\n  \'files_data\' => \n  array (\n  ),\n  \'cookie_data\' => \n  array (\n    \'PHPSESSID\' => \'tf4amie2bhe1lmmgqh3s4juhfl\',\n  ),\n  \'ip_address\' => \'84.82.86.140\',\n)');

--
-- Table structure for table `admin_module`
--

CREATE TABLE `admin_module` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_51EC17D15E237E06` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_module`
--


--
-- Table structure for table `admin_permit_entity`
--

CREATE TABLE `admin_permit_entity` (
  `id` int NOT NULL AUTO_INCREMENT,
  `entity` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `underscoreFullEntityName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `databaseTableName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_EB494E8BB17020E3` (`underscoreFullEntityName`),
  UNIQUE KEY `UNIQ_EB494E8B90E82CE5` (`databaseTableName`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_permit_entity`
--

INSERT INTO `admin_permit_entity` VALUES (2,'Equipment','equipment_entity_equipment','equipment_equipment'),(6,'Group (organisation)','organisation_entity_group','organisation_group'),(7,'Team (organisation)','organisation_entity_team','organisation_team'),(8,'Project (organisation)','organisation_entity_project','organisation_project'),(9,'Substrate','substrate_entity_substrate','substrate_substrate'),(11,'Process','process_entity_process','process_process'),(14,'Run','run_entity_run','run_run'),(16,'Template','template_entity_template','template_template'),(19,'Monitor','equipment_entity_monitor','equipment_monitor'),(23,'Equipment request','equipment_entity_equipment_request','equipment_equipment_request'),(25,'Consumable','consumable_entity_consumable','consumable_consumable'),(26,'Chemical','chemical_entity_chemical','chemical_chemical'),(27,'User','admin_entity_user','admin_user'),(28,'Room','room_entity_room','room_room'),(29,'Facility (gas, water, etc)','facility_entity_facility','facility_facility'),(30,'Room request','room_entity_room_request','room_room_request'),(31,'Chemical container','chemical_entity_container_container','chemical_container'),(32,'Equipment module','equipment_entity_module','equipment_module'),(33,'Area','location_entity_area','location_area'),(34,'Facility (location)','location_entity_facility','location_facility'),(35,'Messages (location)','location_entity_message','location_message'),(36,'Equipment reservation','equipment_entity_equipment_reservation','equipment_reservation'),(37,'Zone reservation','room_entity_zone_reservation','room_zone_reservation'),(38,'Zone','room_entity_zone','room_zone'),(39,'Sensors','sensor_entity_sensor','sensor_sensor');

--
-- Table structure for table `admin_permit_role`
--

CREATE TABLE `admin_permit_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `entity_id` int NOT NULL,
  `role` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_E839709681257D5D` (`entity_id`),
  CONSTRAINT `FK_E839709681257D5D` FOREIGN KEY (`entity_id`) REFERENCES `admin_permit_entity` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=174 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_permit_role`
--

INSERT INTO `admin_permit_role` VALUES (4,2,'list'),(5,2,'new'),(6,2,'edit'),(7,2,'view'),(20,6,'list'),(21,6,'new'),(22,6,'edit'),(23,6,'view'),(24,7,'list'),(25,7,'new'),(26,7,'edit'),(27,7,'view'),(29,8,'list'),(30,8,'edit'),(31,8,'view'),(32,9,'new'),(33,9,'list'),(34,9,'edit'),(35,9,'view'),(41,11,'new'),(42,11,'list'),(43,11,'edit'),(44,11,'view'),(53,14,'new'),(54,14,'list'),(55,14,'edit'),(56,14,'view'),(57,16,'new'),(58,16,'view'),(59,16,'edit'),(60,16,'list'),(76,8,'new'),(85,19,'list'),(86,19,'view'),(87,19,'edit'),(88,19,'new'),(108,23,'view'),(109,23,'edit'),(114,25,'view'),(115,25,'edit'),(116,25,'new'),(117,25,'list'),(118,26,'list'),(119,26,'view'),(120,26,'edit'),(121,26,'new'),(122,27,'list'),(123,27,'view'),(124,27,'edit'),(125,28,'list'),(126,28,'view'),(127,28,'edit'),(128,28,'new'),(129,29,'new'),(130,27,'view-admin'),(132,30,'edit'),(133,30,'view'),(135,27,'impersonate'),(136,31,'list'),(137,31,'edit'),(138,31,'view'),(139,31,'new'),(140,32,'list'),(141,32,'view'),(142,32,'edit'),(143,32,'new'),(144,27,'new'),(145,2,'operator'),(146,2,'reserve'),(147,2,'statusmail'),(148,33,'new'),(149,33,'list'),(151,33,'view'),(152,33,'edit'),(153,34,'new'),(154,34,'list'),(155,34,'view'),(156,34,'edit'),(157,35,'new'),(158,35,'list'),(159,35,'view'),(160,35,'edit'),(161,29,'list'),(162,29,'view'),(163,29,'edit'),(164,36,'edit'),(165,37,'edit'),(166,37,'list'),(167,37,'view'),(168,37,'new'),(169,28,'mail-users'),(170,14,'approve'),(171,2,'mail-users'),(172,38,'edit'),(173,30,'mentor_approval');

--
-- Table structure for table `admin_permit_role_access_role`
--

CREATE TABLE `admin_permit_role_access_role` (
  `permit_role_id` int NOT NULL,
  `access_role_id` int NOT NULL,
  PRIMARY KEY (`permit_role_id`,`access_role_id`),
  KEY `IDX_97C5A19C3CEDC640` (`permit_role_id`),
  KEY `IDX_97C5A19C1E26F8B9` (`access_role_id`),
  CONSTRAINT `FK_97C5A19C1E26F8B9` FOREIGN KEY (`access_role_id`) REFERENCES `admin_role` (`id`),
  CONSTRAINT `FK_97C5A19C3CEDC640` FOREIGN KEY (`permit_role_id`) REFERENCES `admin_permit_role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_permit_role_access_role`
--

INSERT INTO `admin_permit_role_access_role` VALUES (4,1),(4,2),(5,1),(6,1),(7,1),(7,2),(20,1),(20,2),(21,1),(22,1),(23,1),(23,2),(24,1),(24,2),(25,1),(26,1),(27,1),(27,2),(29,1),(29,4),(29,10),(30,1),(30,4),(30,10),(31,1),(31,4),(31,10),(32,1),(33,1),(33,2),(34,1),(35,1),(35,2),(41,1),(42,1),(42,2),(43,1),(44,1),(44,2),(53,1),(53,2),(53,6),(54,1),(55,1),(56,1),(56,10),(57,1),(57,2),(58,1),(58,2),(59,1),(60,1),(60,2),(76,1),(76,4),(76,10),(85,1),(85,2),(86,1),(86,2),(87,1),(88,1),(108,1),(109,1),(114,1),(114,2),(115,1),(116,1),(117,1),(117,2),(118,1),(118,2),(119,1),(119,2),(120,1),(121,1),(122,1),(122,2),(123,1),(123,2),(124,1),(125,1),(125,2),(126,1),(126,2),(127,1),(128,1),(129,1),(130,1),(132,1),(133,1),(135,1),(136,1),(136,2),(137,1),(137,2),(138,1),(138,2),(139,1),(139,2),(140,1),(140,2),(141,1),(141,2),(142,1),(143,1),(144,1),(145,1),(146,1),(146,2),(147,1),(147,2),(148,1),(149,1),(149,2),(151,1),(151,2),(152,1),(153,1),(154,1),(154,2),(155,1),(155,2),(156,1),(157,1),(158,1),(158,2),(159,1),(159,2),(160,1),(161,1),(161,2),(162,1),(162,2),(163,1),(164,1),(165,1),(166,1),(166,2),(167,1),(167,2),(168,1),(168,2),(169,1),(170,10),(171,1),(172,1);

--
-- Table structure for table `admin_permit_setter`
--

CREATE TABLE `admin_permit_setter` (
  `id` int NOT NULL AUTO_INCREMENT,
  `entity_id` int NOT NULL,
  `setter` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entityKey` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fromClause` tinytext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `whereClause` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `userKey` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_99E354A781257D5D` (`entity_id`),
  CONSTRAINT `FK_99E354A781257D5D` FOREIGN KEY (`entity_id`) REFERENCES `admin_permit_entity` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_permit_setter`
--

INSERT INTO `admin_permit_setter` VALUES (1,14,'Run Owner','run_run.id','run_run JOIN admin_user ON admin_user.id = run_run.user_id','admin_user.status = 1','run_run.user_id'),(6,16,'Template owner','template_template.id','template_template JOIN admin_user ON admin_user.id = template_template.user_id','admin_user.status = 1','template_template.user_id'),(7,14,'Project responsible','run_run.id','organisation_project_role JOIN run_run ON run_run.project_id = organisation_project_role.project_id','organisation_project_role.status = 1 AND organisation_project_role.startDate <= NOW() AND (organisation_project_role.endDate IS NULL OR organisation_project_role.endDate >= NOW())','organisation_project_role.user_id'),(9,8,'Project responsible','organisation_project_role.project_id','organisation_project_role  JOIN admin_user ON admin_user.id = organisation_project_role.user_id','organisation_project_role.status = 1 AND organisation_project_role.startDate < NOW() AND (organisation_project_role.endDate IS NULL OR organisation_project_role.endDate > NOW()) AND admin_user.status = 1','organisation_project_role.user_id'),(10,8,'Team leader','organisation_project_team.project_id','organisation_team_role JOIN organisation_project_team ON organisation_project_team.team_id = organisation_team_role.team_id  JOIN admin_user ON admin_user.id = organisation_team_role.user_id','organisation_team_role.status = 1 AND organisation_team_role.startDate < NOW() AND (organisation_team_role.endDate IS NULL OR organisation_team_role.endDate > NOW()) AND admin_user.status = 1','organisation_team_role.user_id'),(12,7,'Team member','organisation_team_user.team_id','organisation_team_user JOIN admin_user ON admin_user.id = organisation_team_user.user_id','organisation_team_user.status = 1 AND startDate < NOW() AND (organisation_team_user.endDate IS NULL OR organisation_team_user.endDate > NOW()) AND admin_user.status = 1','organisation_team_user.user_id'),(13,7,'Team responsible','organisation_team_role.team_id','organisation_team_role  JOIN admin_user ON admin_user.id = organisation_team_role.user_id','organisation_team_role.status = 1 AND startDate < NOW() AND (endDate IS NULL OR endDate > NOW()) AND admin_user.status = 1','organisation_team_role.user_id'),(14,6,'Group member','organisation_group_user.group_id','organisation_group_user  JOIN admin_user ON admin_user.id = organisation_group_user.user_id','organisation_group_user.status = 1 AND startDate < NOW() AND (endDate IS NULL OR endDate > NOW()) AND admin_user.status = 1','organisation_group_user.user_id'),(15,8,'Project member','organisation_project_user.project_id','organisation_project_user INNER JOIN admin_user ON admin_user.id = organisation_project_user.user_id','organisation_project_user.status = 1 AND startDate < NOW() AND (endDate IS NULL OR endDate > NOW()) AND admin_user.status = 1','organisation_project_user.user_id'),(16,6,'Group leader','organisation_group_role.group_id','organisation_group_role  JOIN admin_user ON admin_user.id = organisation_group_role.user_id','organisation_group_role.status = 1 AND startDate < NOW() AND (endDate IS NULL OR endDate > NOW()) AND admin_user.status = 1','organisation_group_role.user_id'),(17,9,'Substrate via project responsible','substrate_substrate.id','organisation_project_role JOIN substrate_substrate ON substrate_substrate.project_id = organisation_project_role.project_id JOIN admin_user ON admin_user.id = organisation_project_role.user_id','organisation_project_role.status = 1 AND startDate <= NOW() AND (endDate IS NULL OR endDate >= NOW()) AND admin_user.status = 1','organisation_project_role.user_id'),(19,9,'Substrate owner','substrate_substrate.id','substrate_substrate JOIN admin_user ON substrate_substrate.user_id = admin_user.id','admin_user.status = 1','substrate_substrate.user_id'),(20,16,'Template via project responsible','template_template.id','organisation_project_role JOIN template_template ON template_template .project_id = organisation_project_role.project_id JOIN admin_user ON admin_user.id = organisation_project_role.user_id','organisation_project_role.status = 1 AND startDate <= NOW() AND (endDate IS NULL OR endDate >= NOW()) AND admin_user.status = 1','organisation_project_role.user_id'),(21,16,'Template via project member','template_template.id','organisation_project_user JOIN template_template  ON template_template.project_id = organisation_project_user.project_id JOIN admin_user ON admin_user.id = organisation_project_user.user_id','organisation_project_user.status = 1 AND startDate <= NOW() AND (endDate IS NULL OR endDate >= NOW()) AND admin_user.status = 1','organisation_project_user.user_id'),(22,14,'Project member','run_run.id','organisation_project_user JOIN run_run ON run_run.project_id = organisation_project_user.project_id','organisation_project_user.status = 1 AND organisation_project_user.startDate <= NOW() AND (organisation_project_user.endDate IS NULL OR organisation_project_user.endDate >= NOW())','organisation_project_user.user_id'),(23,19,'Monitor process owner','equipment_monitor.id','equipment_monitor','','equipment_monitor.user_id'),(37,23,'Request owner','equipment_equipment_request.id','equipment_equipment_request','','equipment_equipment_request.user_id'),(38,23,'Equipment responsible','equipment_equipment_request.id','equipment_equipment_request\n         CROSS JOIN equipment_equipment_role ON equipment_equipment_role.equipment_id = equipment_equipment_request.equipment_id','equipment_equipment_role.inApprovalFlow = 1','equipment_equipment_role.user_id'),(39,14,'Involved user','run_run_role.run_id','run_run_role','run_run_role.role_id = 1','run_run_role.user_id'),(40,14,'Project responsible and Management','run_run.id','organisation_project_role INNER JOIN run_run ON run_run.project_id = organisation_project_role.project_id','organisation_project_role.status = 1 AND organisation_project_role.startDate <= NOW() AND (organisation_project_role.endDate IS NULL OR organisation_project_role.endDate >= NOW())\n\nAND\n\norganisation_project_role.user_id IN (SELECT user_id FROM admin_user_role WHERE role_id = 10)','organisation_project_role.user_id'),(41,2,'User is trained on equipment','equipment_id','equipment_equipment_user JOIN admin_user ON admin_user.id = equipment_equipment_user.user_id','equipment_equipment_user.status = 1 AND admin_user.status = 1','equipment_equipment_user.user_id'),(42,2,'User has role on equipment','equipment_id','equipment_equipment_role JOIN admin_user ON admin_user.id = equipment_equipment_role.user_id','admin_user.status = 1','equipment_equipment_role.user_id'),(44,8,'Public projects','organisation_project.id','organisation_project CROSS JOIN admin_user','admin_user.status = 1 AND organisation_project.private = 0 AND organisation_project.endDate IS NULL','admin_user.id'),(45,30,'Request owner','room_room_request.id','room_room_request','','room_room_request.user_id'),(46,30,'Room responsible','room_room_request.id','room_room_request CROSS JOIN room_room_role ON room_room_role.room_id = room_room_request.room_id','room_room_role.inApprovalFlow = 1 AND room_room_role.status = 1','room_room_role.user_id'),(47,28,'Room responsible','room_room_role.room_id','room_room_role','room_room_role.status = 1','room_room_role.user_id'),(48,28,'Trained user','room_room_user.room_id','room_room_user','room_room_user.status IN (1, 5)','room_room_user.user_id'),(49,14,'Runs in public projects','run_run.id','run_run INNER JOIN organisation_project ON organisation_project.id = run_run.project_id CROSS JOIN admin_user','organisation_project.status = 1 AND organisation_project.private = 0 AND admin_user.status = 1 AND admin_user.id IN (SELECT user_id FROM admin_user_role WHERE role_id = 2)','admin_user.id'),(50,30,'Request mentor','room_room_request.id','room_room_request','room_room_request.user_mentor_id IS NOT NULL','room_room_request.user_mentor_id'),(51,2,'Room responsible','equipment_equipment.id','equipment_equipment CROSS JOIN room_room_role ON room_room_role.room_id = equipment_equipment.room_id','room_room_role.status = 1','room_room_role.user_id'),(52,23,'Room responsible','equipment_equipment_request.id','equipment_equipment_request\n\nINNER JOIN equipment_equipment ON equipment_equipment.id = equipment_equipment_request.equipment_id\n\nCROSS JOIN room_room_role ON room_room_role.room_id = equipment_equipment.room_id','room_room_role.status = 1','room_room_role.user_id'),(53,38,'Room responsible','room_zone.id','room_zone INNER JOIN room_zone_group ON room_zone.group_id = room_zone_group.id CROSS JOIN room_room_role ON room_zone_group.room_id = room_room_role.room_id','room_room_role.status = 1','room_room_role.user_id');

--
-- Table structure for table `admin_permit_setter_role`
--

CREATE TABLE `admin_permit_setter_role` (
  `setter_id` int NOT NULL,
  `role_id` int NOT NULL,
  PRIMARY KEY (`setter_id`,`role_id`),
  KEY `IDX_87037EA8365C7286` (`setter_id`),
  KEY `IDX_87037EA8D60322AC` (`role_id`),
  CONSTRAINT `FK_87037EA8365C7286` FOREIGN KEY (`setter_id`) REFERENCES `admin_permit_setter` (`id`),
  CONSTRAINT `FK_87037EA8D60322AC` FOREIGN KEY (`role_id`) REFERENCES `admin_permit_role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_permit_setter_role`
--

INSERT INTO `admin_permit_setter_role` VALUES (1,54),(1,55),(1,56),(6,58),(6,59),(6,60),(7,55),(7,56),(7,170),(9,29),(9,30),(9,31),(10,29),(10,30),(10,31),(12,27),(13,26),(13,27),(14,20),(14,23),(15,29),(15,30),(15,31),(16,20),(16,22),(16,23),(17,34),(19,34),(20,58),(20,59),(20,60),(21,58),(21,59),(21,60),(22,56),(23,86),(23,87),(37,108),(38,108),(38,109),(39,54),(39,55),(39,56),(40,54),(40,55),(40,56),(40,170),(41,171),(42,6),(42,171),(44,29),(44,31),(45,133),(46,132),(46,133),(47,127),(47,169),(48,169),(49,54),(49,56),(50,133),(50,173),(51,5),(51,6),(51,171),(52,108),(52,109),(53,172);

--
-- Table structure for table `admin_permit_user`
--

CREATE TABLE `admin_permit_user` (
  `key_id` int NOT NULL,
  `user_id` int NOT NULL,
  `role_id` int NOT NULL,
  `setter_id` int DEFAULT NULL,
  `access_role_id` int DEFAULT NULL,
  PRIMARY KEY (`key_id`,`user_id`,`role_id`),
  KEY `IDX_32C32CB5A76ED395` (`user_id`),
  KEY `IDX_32C32CB5D60322AC` (`role_id`),
  KEY `IDX_32C32CB5365C7286` (`setter_id`),
  KEY `IDX_32C32CB51E26F8B9` (`access_role_id`),
  KEY `admin_permit_user_key_index` (`key_id`),
  CONSTRAINT `FK_32C32CB51E26F8B9` FOREIGN KEY (`access_role_id`) REFERENCES `admin_role` (`id`),
  CONSTRAINT `FK_32C32CB5365C7286` FOREIGN KEY (`setter_id`) REFERENCES `admin_permit_setter` (`id`),
  CONSTRAINT `FK_32C32CB5A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_32C32CB5D60322AC` FOREIGN KEY (`role_id`) REFERENCES `admin_permit_role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_permit_user`
--

INSERT INTO `admin_permit_user` VALUES (0,1,4,NULL,1),(0,1,5,NULL,1),(0,1,6,NULL,1),(0,1,7,NULL,1),(0,1,20,NULL,1),(0,1,21,NULL,1),(0,1,22,NULL,1),(0,1,23,NULL,1),(0,1,24,NULL,1),(0,1,25,NULL,1),(0,1,26,NULL,1),(0,1,27,NULL,1),(0,1,29,NULL,1),(0,1,30,NULL,1),(0,1,31,NULL,1),(0,1,32,NULL,1),(0,1,33,NULL,1),(0,1,34,NULL,1),(0,1,35,NULL,1),(0,1,41,NULL,1),(0,1,42,NULL,1),(0,1,43,NULL,1),(0,1,44,NULL,1),(0,1,53,NULL,1),(0,1,54,NULL,1),(0,1,55,NULL,1),(0,1,56,NULL,1),(0,1,57,NULL,1),(0,1,58,NULL,1),(0,1,59,NULL,1),(0,1,60,NULL,1),(0,1,76,NULL,1),(0,1,85,NULL,1),(0,1,86,NULL,1),(0,1,87,NULL,1),(0,1,88,NULL,1),(0,1,108,NULL,1),(0,1,109,NULL,1),(0,1,114,NULL,1),(0,1,115,NULL,1),(0,1,116,NULL,1),(0,1,117,NULL,1),(0,1,118,NULL,1),(0,1,119,NULL,1),(0,1,120,NULL,1),(0,1,121,NULL,1),(0,1,122,NULL,1),(0,1,123,NULL,1),(0,1,124,NULL,1),(0,1,125,NULL,1),(0,1,126,NULL,1),(0,1,127,NULL,1),(0,1,128,NULL,1),(0,1,129,NULL,1),(0,1,130,NULL,1),(0,1,132,NULL,1),(0,1,133,NULL,1),(0,1,135,NULL,1),(0,1,136,NULL,1),(0,1,137,NULL,1),(0,1,138,NULL,1),(0,1,139,NULL,1),(0,1,140,NULL,1),(0,1,141,NULL,1),(0,1,142,NULL,1),(0,1,143,NULL,1),(0,1,144,NULL,1),(0,1,145,NULL,1),(0,1,146,NULL,1),(0,1,147,NULL,1),(0,1,148,NULL,1),(0,1,149,NULL,1),(0,1,151,NULL,1),(0,1,152,NULL,1),(0,1,153,NULL,1),(0,1,154,NULL,1),(0,1,155,NULL,1),(0,1,156,NULL,1),(0,1,157,NULL,1),(0,1,158,NULL,1),(0,1,159,NULL,1),(0,1,160,NULL,1),(0,1,161,NULL,1),(0,1,162,NULL,1),(0,1,163,NULL,1),(0,1,164,NULL,1),(0,1,165,NULL,1),(0,1,166,NULL,1),(0,1,167,NULL,1),(0,1,168,NULL,1),(0,1,169,NULL,1),(0,1,171,NULL,1),(0,1,172,NULL,1),(1,1,122,NULL,1),(1,1,123,NULL,1),(1,1,124,NULL,1),(1,1,130,NULL,1),(1,1,135,NULL,1),(1,1,144,NULL,1);

--
-- Table structure for table `admin_role`
--

CREATE TABLE `admin_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `parent` int DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_7770088A5E237E06` (`name`),
  KEY `IDX_7770088A3D8E604F` (`parent`),
  CONSTRAINT `FK_7770088A3D8E604F` FOREIGN KEY (`parent`) REFERENCES `admin_role` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_role`
--

INSERT INTO `admin_role` VALUES (1,NULL,'Admin','General admin'),(2,NULL,'User','User'),(3,NULL,'Guest','Guest'),(4,NULL,'Account admin','User responsible for account management'),(5,NULL,'Process admin','User responsible for process management'),(6,NULL,'Industrial Resident','Industrial Resident'),(7,NULL,'Engineer','Engineer'),(8,NULL,'Training responsible','Training responsible'),(9,NULL,'External user','User working in another institute or organisation'),(10,NULL,'Management','Member of the management team'),(11,NULL,'Operator','Operator role');

--
-- Table structure for table `admin_role_selection`
--

CREATE TABLE `admin_role_selection` (
  `role_id` int NOT NULL,
  `selection_id` int NOT NULL,
  PRIMARY KEY (`role_id`,`selection_id`),
  KEY `IDX_1459E92FD60322AC` (`role_id`),
  KEY `IDX_1459E92FE48EFE78` (`selection_id`),
  CONSTRAINT `FK_1459E92FD60322AC` FOREIGN KEY (`role_id`) REFERENCES `admin_role` (`id`),
  CONSTRAINT `FK_1459E92FE48EFE78` FOREIGN KEY (`selection_id`) REFERENCES `admin_selection` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_role_selection`
--


--
-- Table structure for table `admin_selection`
--

CREATE TABLE `admin_selection` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `selection` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `tag` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `endDate` datetime DEFAULT NULL,
  `note` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `core` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_7F5209E5A76ED395` (`user_id`),
  CONSTRAINT `FK_7F5209E5A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_selection`
--

INSERT INTO `admin_selection` VALUES (1,1,'All active users','','2022-08-12 10:59:20',NULL,'',0);

--
-- Table structure for table `admin_selection_sql`
--

CREATE TABLE `admin_selection_sql` (
  `id` int NOT NULL AUTO_INCREMENT,
  `selection_id` int NOT NULL,
  `query` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_30FAAADBE48EFE78` (`selection_id`),
  CONSTRAINT `FK_30FAAADBE48EFE78` FOREIGN KEY (`selection_id`) REFERENCES `admin_selection` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_selection_sql`
--

INSERT INTO `admin_selection_sql` VALUES (1,1,'SELECT id FROM admin_user WHERE status = 1');

--
-- Table structure for table `admin_selection_user`
--

CREATE TABLE `admin_selection_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `selection_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_8A153E90A76ED395` (`user_id`),
  KEY `IDX_8A153E90E48EFE78` (`selection_id`),
  CONSTRAINT `FK_8A153E90A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_8A153E90E48EFE78` FOREIGN KEY (`selection_id`) REFERENCES `admin_selection` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_selection_user`
--


--
-- Table structure for table `admin_session`
--

CREATE TABLE `admin_session` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `key` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `modified` int NOT NULL,
  `lifetime` int NOT NULL,
  `hits` int NOT NULL,
  `data` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ip` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `startDate` datetime NOT NULL,
  `endDate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_1478575DA76ED395` (`user_id`),
  KEY `session_key_idx` (`key`),
  CONSTRAINT `FK_1478575DA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_session`
--

INSERT INTO `admin_session` VALUES (1,1,'1d071a5a9c1a5b271242f0892ea6329d',1658229201,31536000,1,'1','SOLODB_AUTH','192.168.0.6','2022-07-19 08:09:33',NULL),(2,1,'b2afbdb559e0683ad88cd86101899294',1660239305,31536000,1,'1','SOLODB_AUTH','192.168.0.2','2022-08-11 19:34:43',NULL),(3,1,'3vsfp7dvsn50clauaanqen75kq',1660239722,31536000,1,'1','SOLODB_AUTH','84.82.86.140','2022-08-11 19:40:51',NULL),(4,1,'h4imeljs4n5cj60g4d2c67vc3f',1660291453,31536000,1,'1','SOLODB_AUTH','84.82.86.140','2022-08-11 19:57:58',NULL),(5,1,'c4i28spk22fspnlbmi9jmqko3d',1660295951,31536000,1,'1','SOLODB_AUTH','84.82.86.140','2022-08-12 10:09:05',NULL),(6,1,'5a12abf99ed8884ec49702b8cce6c466',1660830282,31536000,1,'1','SOLODB_AUTH','172.18.0.3','2022-08-18 15:16:51',NULL);

--
-- Table structure for table `admin_support`
--

CREATE TABLE `admin_support` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_4438692C5E237E06` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_support`
--


--
-- Table structure for table `admin_support_role`
--

CREATE TABLE `admin_support_role` (
  `support_id` int NOT NULL,
  `role_id` int NOT NULL,
  PRIMARY KEY (`support_id`,`role_id`),
  KEY `IDX_F63EBED4315B405` (`support_id`),
  KEY `IDX_F63EBED4D60322AC` (`role_id`),
  CONSTRAINT `FK_F63EBED4315B405` FOREIGN KEY (`support_id`) REFERENCES `admin_support` (`id`),
  CONSTRAINT `FK_F63EBED4D60322AC` FOREIGN KEY (`role_id`) REFERENCES `admin_role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_support_role`
--


--
-- Table structure for table `admin_user`
--

CREATE TABLE `admin_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `microsoftId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `username` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `password` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `firstName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `lastName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` int NOT NULL,
  `userPrincipalName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `autoUpdate` smallint NOT NULL,
  `triggerUpdate` tinyint(1) NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `dateLeave` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_AD8A54A9F85E0677` (`username`),
  UNIQUE KEY `UNIQ_AD8A54A9E7927C74` (`email`),
  UNIQUE KEY `UNIQ_AD8A54A99B55F444` (`microsoftId`),
  UNIQUE KEY `UNIQ_AD8A54A9F6B27200` (`userPrincipalName`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_user`
--

INSERT INTO `admin_user` VALUES (1,NULL,'vdheide','$2y$14$lha7TB7QoHan0u5twnJmnetjVKTNsrNrHnogt78YpXXSlzSisy5Z6','Johan','van der Heide','info@solodb.net',1,NULL,1,1,'2017-12-17 15:13:37','2022-08-12 10:09:06',NULL);

--
-- Table structure for table `admin_user_action`
--

CREATE TABLE `admin_user_action` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `title` datetime NOT NULL,
  `description` datetime DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `dateClosed` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_BF84DEA6A76ED395` (`user_id`),
  CONSTRAINT `FK_BF84DEA6A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_user_action`
--


--
-- Table structure for table `admin_user_preferences`
--

CREATE TABLE `admin_user_preferences` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `stepsPerPage` smallint NOT NULL,
  `itemsPerPage` smallint NOT NULL,
  `runsOnPortal` smallint NOT NULL,
  `actionElement` smallint NOT NULL,
  `defaultEmphasizedParameters` smallint NOT NULL,
  `reservationColor` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `reservationEmailNotifications` smallint NOT NULL,
  `trainingEmailNotifications` smallint NOT NULL,
  `layout` smallint NOT NULL,
  `filters` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci COMMENT '(DC2Type:array)',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_7E78C857A76ED395` (`user_id`),
  CONSTRAINT `FK_7E78C857A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_user_preferences`
--


--
-- Table structure for table `admin_user_preferences_modules`
--

CREATE TABLE `admin_user_preferences_modules` (
  `preferences_id` int NOT NULL,
  `module_id` int NOT NULL,
  PRIMARY KEY (`preferences_id`,`module_id`),
  KEY `IDX_5B7D589B7CCD6FB7` (`preferences_id`),
  KEY `IDX_5B7D589BAFC2B591` (`module_id`),
  CONSTRAINT `FK_5B7D589B7CCD6FB7` FOREIGN KEY (`preferences_id`) REFERENCES `admin_user_preferences` (`id`),
  CONSTRAINT `FK_5B7D589BAFC2B591` FOREIGN KEY (`module_id`) REFERENCES `admin_module` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_user_preferences_modules`
--


--
-- Table structure for table `admin_user_preferences_sites`
--

CREATE TABLE `admin_user_preferences_sites` (
  `preferences_id` int NOT NULL,
  `site_id` int NOT NULL,
  PRIMARY KEY (`preferences_id`,`site_id`),
  KEY `IDX_E3210837CCD6FB7` (`preferences_id`),
  KEY `IDX_E321083F6BD1646` (`site_id`),
  CONSTRAINT `FK_E3210837CCD6FB7` FOREIGN KEY (`preferences_id`) REFERENCES `admin_user_preferences` (`id`),
  CONSTRAINT `FK_E321083F6BD1646` FOREIGN KEY (`site_id`) REFERENCES `room_site` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_user_preferences_sites`
--


--
-- Table structure for table `admin_user_profile`
--

CREATE TABLE `admin_user_profile` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `companyName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `mobilePhone` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `phone` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `jobTitle` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `officeLocation` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `location` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `country` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `payroll` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `statute` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `equivalency` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `department` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `personnelNumber` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_A01B16E8A76ED395` (`user_id`),
  CONSTRAINT `FK_A01B16E8A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_user_profile`
--


--
-- Table structure for table `admin_user_role`
--

CREATE TABLE `admin_user_role` (
  `user_id` int NOT NULL,
  `role_id` int NOT NULL,
  PRIMARY KEY (`user_id`,`role_id`),
  KEY `IDX_C41FC391A76ED395` (`user_id`),
  KEY `IDX_C41FC391D60322AC` (`role_id`),
  CONSTRAINT `FK_C41FC391A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_C41FC391D60322AC` FOREIGN KEY (`role_id`) REFERENCES `admin_role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `admin_user_role`
--

INSERT INTO `admin_user_role` VALUES (1,1);

--
-- Table structure for table `chemical_chemical`
--

CREATE TABLE `chemical_chemical` (
  `id` int NOT NULL AUTO_INCREMENT,
  `main_chemical_id` int DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `casNumber` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `chemical_formula` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `standardProduct` smallint NOT NULL,
  `physicalState` smallint NOT NULL,
  `isHalogenated` tinyint(1) NOT NULL,
  `containsMetals` tinyint(1) NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `ehs_link` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_236794A035F4C2E0` (`main_chemical_id`),
  CONSTRAINT `FK_236794A035F4C2E0` FOREIGN KEY (`main_chemical_id`) REFERENCES `chemical_main_chemical` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_chemical`
--


--
-- Table structure for table `chemical_chemical_cmr`
--

CREATE TABLE `chemical_chemical_cmr` (
  `chemical_id` int NOT NULL,
  `cmr_id` int NOT NULL,
  PRIMARY KEY (`chemical_id`,`cmr_id`),
  KEY `IDX_A9493550E1770A76` (`chemical_id`),
  KEY `IDX_A94935506361B9E` (`cmr_id`),
  CONSTRAINT `FK_A94935506361B9E` FOREIGN KEY (`cmr_id`) REFERENCES `chemical_cmr` (`id`),
  CONSTRAINT `FK_A9493550E1770A76` FOREIGN KEY (`chemical_id`) REFERENCES `chemical_chemical` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_chemical_cmr`
--


--
-- Table structure for table `chemical_chemical_role`
--

CREATE TABLE `chemical_chemical_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `chemical_id` int NOT NULL,
  `role_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  `inApprovalFlow` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_BB78B9D0E1770A76D60322ACA76ED395` (`chemical_id`,`role_id`,`user_id`),
  KEY `IDX_BB78B9D0E1770A76` (`chemical_id`),
  KEY `IDX_BB78B9D0D60322AC` (`role_id`),
  KEY `IDX_BB78B9D0A76ED395` (`user_id`),
  CONSTRAINT `FK_BB78B9D0A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_BB78B9D0D60322AC` FOREIGN KEY (`role_id`) REFERENCES `chemical_role` (`id`),
  CONSTRAINT `FK_BB78B9D0E1770A76` FOREIGN KEY (`chemical_id`) REFERENCES `chemical_chemical` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_chemical_role`
--


--
-- Table structure for table `chemical_chemical_safety_icon`
--

CREATE TABLE `chemical_chemical_safety_icon` (
  `chemical_id` int NOT NULL,
  `icon_id` int NOT NULL,
  PRIMARY KEY (`chemical_id`,`icon_id`),
  KEY `IDX_884B9F12E1770A76` (`chemical_id`),
  KEY `IDX_884B9F1254B9D732` (`icon_id`),
  CONSTRAINT `FK_884B9F1254B9D732` FOREIGN KEY (`icon_id`) REFERENCES `chemical_safety_icon` (`id`),
  CONSTRAINT `FK_884B9F12E1770A76` FOREIGN KEY (`chemical_id`) REFERENCES `chemical_chemical` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_chemical_safety_icon`
--


--
-- Table structure for table `chemical_chemical_safety_statement`
--

CREATE TABLE `chemical_chemical_safety_statement` (
  `chemical_id` int NOT NULL,
  `statement_id` int NOT NULL,
  PRIMARY KEY (`chemical_id`,`statement_id`),
  KEY `IDX_71C23536E1770A76` (`chemical_id`),
  KEY `IDX_71C23536849CB65B` (`statement_id`),
  CONSTRAINT `FK_71C23536849CB65B` FOREIGN KEY (`statement_id`) REFERENCES `chemical_safety_statement` (`id`),
  CONSTRAINT `FK_71C23536E1770A76` FOREIGN KEY (`chemical_id`) REFERENCES `chemical_chemical` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_chemical_safety_statement`
--


--
-- Table structure for table `chemical_cmr`
--

CREATE TABLE `chemical_cmr` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_9DB62015E237E06` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_cmr`
--


--
-- Table structure for table `chemical_container`
--

CREATE TABLE `chemical_container` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type_id` int NOT NULL,
  `user_id` int NOT NULL,
  `chemical_id` int NOT NULL,
  `location_id` int NOT NULL,
  `project_id` int DEFAULT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `deletedAt` datetime DEFAULT NULL,
  `dateExpire` datetime DEFAULT NULL,
  `date_opened` datetime DEFAULT NULL,
  `dateMarkedForRemoval` datetime DEFAULT NULL,
  `sub_location` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `order_number` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `supplier` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `concentration` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `amount` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `date_arrived` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_13B46280C54C8C93` (`type_id`),
  KEY `IDX_13B46280A76ED395` (`user_id`),
  KEY `IDX_13B46280E1770A76` (`chemical_id`),
  KEY `IDX_13B4628064D218E` (`location_id`),
  KEY `IDX_13B46280166D1F9C` (`project_id`),
  CONSTRAINT `FK_13B46280166D1F9C` FOREIGN KEY (`project_id`) REFERENCES `organisation_project` (`id`),
  CONSTRAINT `FK_13B4628064D218E` FOREIGN KEY (`location_id`) REFERENCES `room_location` (`id`),
  CONSTRAINT `FK_13B46280A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_13B46280C54C8C93` FOREIGN KEY (`type_id`) REFERENCES `chemical_container_type` (`id`),
  CONSTRAINT `FK_13B46280E1770A76` FOREIGN KEY (`chemical_id`) REFERENCES `chemical_chemical` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_container`
--


--
-- Table structure for table `chemical_container_changelog`
--

CREATE TABLE `chemical_container_changelog` (
  `id` int NOT NULL AUTO_INCREMENT,
  `container_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `type` int NOT NULL,
  `message` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_15C47931BC21F742` (`container_id`),
  KEY `IDX_15C47931A76ED395` (`user_id`),
  CONSTRAINT `FK_15C47931A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_15C47931BC21F742` FOREIGN KEY (`container_id`) REFERENCES `chemical_container` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_container_changelog`
--


--
-- Table structure for table `chemical_container_type`
--

CREATE TABLE `chemical_container_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `label_id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_528ABF765E237E06` (`name`),
  KEY `IDX_528ABF7633B92F39` (`label_id`),
  CONSTRAINT `FK_528ABF7633B92F39` FOREIGN KEY (`label_id`) REFERENCES `chemical_label` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_container_type`
--

INSERT INTO `chemical_container_type` VALUES (1,1,'Large container'),(2,2,'Small container');

--
-- Table structure for table `chemical_container_user`
--

CREATE TABLE `chemical_container_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `container_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `deletedAt` datetime DEFAULT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_53C73E16BC21F742` (`container_id`),
  KEY `IDX_53C73E16A76ED395` (`user_id`),
  CONSTRAINT `FK_53C73E16A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_53C73E16BC21F742` FOREIGN KEY (`container_id`) REFERENCES `chemical_container` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_container_user`
--


--
-- Table structure for table `chemical_label`
--

CREATE TABLE `chemical_label` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `mm_top` int NOT NULL,
  `mm_left` int NOT NULL,
  `mm_width` int NOT NULL,
  `mm_height` int NOT NULL,
  `layout` json DEFAULT NULL,
  `labelType` smallint NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_label`
--

INSERT INTO `chemical_label` VALUES (1,'Large container','2022-08-12 10:56:03','2022-08-12 10:56:03',0,0,0,0,NULL,0),(2,'Small container','2022-08-12 10:56:10','2022-08-12 10:56:10',0,0,0,0,NULL,0);

--
-- Table structure for table `chemical_label_attachment`
--

CREATE TABLE `chemical_label_attachment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `label_id` int NOT NULL,
  `attachment` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `size` int DEFAULT NULL,
  `type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `priority` smallint NOT NULL,
  `sequence` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_245A0BFC33B92F39` (`label_id`),
  CONSTRAINT `FK_245A0BFC33B92F39` FOREIGN KEY (`label_id`) REFERENCES `chemical_label` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_label_attachment`
--


--
-- Table structure for table `chemical_label_attachment_object`
--

CREATE TABLE `chemical_label_attachment_object` (
  `id` int NOT NULL AUTO_INCREMENT,
  `attachment_id` int NOT NULL,
  `object` longblob NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_C5740302464E68B` (`attachment_id`),
  CONSTRAINT `FK_C5740302464E68B` FOREIGN KEY (`attachment_id`) REFERENCES `chemical_label_attachment` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_label_attachment_object`
--


--
-- Table structure for table `chemical_main_chemical`
--

CREATE TABLE `chemical_main_chemical` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `code` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `requireMSDS` smallint NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_4B370F835E237E06` (`name`),
  UNIQUE KEY `UNIQ_4B370F8377153098` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_main_chemical`
--

INSERT INTO `chemical_main_chemical` VALUES (1,'Acid','Acid','2022-08-12 10:54:53',1,'2022-08-12 10:54:53'),(2,'Base','base','2022-08-12 10:55:05',1,'2022-08-12 10:55:05');

--
-- Table structure for table `chemical_role`
--

CREATE TABLE `chemical_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `sequence` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_A7B44AE52B36786B` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_role`
--


--
-- Table structure for table `chemical_safety_icon`
--

CREATE TABLE `chemical_safety_icon` (
  `id` int NOT NULL AUTO_INCREMENT,
  `class` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mimeType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `extension` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fileSize` int NOT NULL,
  `width` int NOT NULL,
  `height` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `image` longblob NOT NULL,
  `hash` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_D73C93ADED4B199F` (`class`),
  UNIQUE KEY `UNIQ_D73C93ADD1B862B8` (`hash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_safety_icon`
--


--
-- Table structure for table `chemical_safety_statement`
--

CREATE TABLE `chemical_safety_statement` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `number` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `statement` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_C51E2A0596901F54` (`number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_safety_statement`
--


--
-- Table structure for table `chemical_safety_statement_cmr`
--

CREATE TABLE `chemical_safety_statement_cmr` (
  `statement_id` int NOT NULL,
  `cmr_id` int NOT NULL,
  PRIMARY KEY (`statement_id`,`cmr_id`),
  KEY `IDX_ABA88A8F849CB65B` (`statement_id`),
  KEY `IDX_ABA88A8F6361B9E` (`cmr_id`),
  CONSTRAINT `FK_ABA88A8F6361B9E` FOREIGN KEY (`cmr_id`) REFERENCES `chemical_cmr` (`id`),
  CONSTRAINT `FK_ABA88A8F849CB65B` FOREIGN KEY (`statement_id`) REFERENCES `chemical_safety_statement` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chemical_safety_statement_cmr`
--


--
-- Table structure for table `consumable_consumable`
--

CREATE TABLE `consumable_consumable` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `type_id` int NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `information` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  `approvalRequired` smallint NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `location_id` int NOT NULL,
  `number` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_88D19BEF96901F54` (`number`),
  KEY `IDX_88D19BEFA76ED395` (`user_id`),
  KEY `IDX_88D19BEFC54C8C93` (`type_id`),
  KEY `IDX_88D19BEF64D218E` (`location_id`),
  CONSTRAINT `FK_88D19BEF64D218E` FOREIGN KEY (`location_id`) REFERENCES `room_location` (`id`),
  CONSTRAINT `FK_88D19BEFA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_88D19BEFC54C8C93` FOREIGN KEY (`type_id`) REFERENCES `consumable_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `consumable_consumable`
--


--
-- Table structure for table `consumable_consumable_file`
--

CREATE TABLE `consumable_consumable_file` (
  `consumable_id` int NOT NULL,
  `file_id` int NOT NULL,
  PRIMARY KEY (`consumable_id`,`file_id`),
  KEY `IDX_6E6E3DE4A94ADB61` (`consumable_id`),
  KEY `IDX_6E6E3DE493CB796C` (`file_id`),
  CONSTRAINT `FK_6E6E3DE493CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`),
  CONSTRAINT `FK_6E6E3DE4A94ADB61` FOREIGN KEY (`consumable_id`) REFERENCES `consumable_consumable` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `consumable_consumable_file`
--


--
-- Table structure for table `consumable_consumable_io`
--

CREATE TABLE `consumable_consumable_io` (
  `id` int NOT NULL AUTO_INCREMENT,
  `consumable_id` int NOT NULL,
  `user_id` int NOT NULL,
  `amount` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `reason` longtext COLLATE utf8mb3_unicode_ci NOT NULL,
  `label` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_304C3A3EA94ADB61` (`consumable_id`),
  KEY `IDX_304C3A3EA76ED395` (`user_id`),
  CONSTRAINT `FK_304C3A3EA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_304C3A3EA94ADB61` FOREIGN KEY (`consumable_id`) REFERENCES `consumable_consumable` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `consumable_consumable_io`
--


--
-- Table structure for table `consumable_consumable_property`
--

CREATE TABLE `consumable_consumable_property` (
  `id` int NOT NULL AUTO_INCREMENT,
  `property_id` int NOT NULL,
  `consumable_id` int NOT NULL,
  `value` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `valueArray` longtext COLLATE utf8mb3_unicode_ci COMMENT '(DC2Type:array)',
  `valueInteger` int DEFAULT NULL,
  `valueDate` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_CD002167549213EC` (`property_id`),
  KEY `IDX_CD002167A94ADB61` (`consumable_id`),
  CONSTRAINT `FK_CD002167549213EC` FOREIGN KEY (`property_id`) REFERENCES `consumable_property` (`id`),
  CONSTRAINT `FK_CD002167A94ADB61` FOREIGN KEY (`consumable_id`) REFERENCES `consumable_consumable` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `consumable_consumable_property`
--


--
-- Table structure for table `consumable_property`
--

CREATE TABLE `consumable_property` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `property` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `label` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `showInList` smallint NOT NULL,
  `values` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `unit` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sort` smallint NOT NULL,
  `friendlyText` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `defaultValue` longtext COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `consumable_property`
--


--
-- Table structure for table `consumable_type`
--

CREATE TABLE `consumable_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `color` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `canBeSubstrate` tinyint(1) NOT NULL,
  `consumptionType` smallint NOT NULL,
  `consumableNumberPrefix` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_8854B94F5E237E06` (`name`),
  UNIQUE KEY `UNIQ_8854B94F53FCB9A3` (`consumableNumberPrefix`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `consumable_type`
--


--
-- Table structure for table `consumable_type_property`
--

CREATE TABLE `consumable_type_property` (
  `type_id` int NOT NULL,
  `property_id` int NOT NULL,
  PRIMARY KEY (`type_id`,`property_id`),
  KEY `IDX_48D903F5C54C8C93` (`type_id`),
  KEY `IDX_48D903F5549213EC` (`property_id`),
  CONSTRAINT `FK_48D903F5549213EC` FOREIGN KEY (`property_id`) REFERENCES `consumable_property` (`id`),
  CONSTRAINT `FK_48D903F5C54C8C93` FOREIGN KEY (`type_id`) REFERENCES `consumable_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `consumable_type_property`
--


--
-- Table structure for table `deeplink`
--

CREATE TABLE `deeplink` (
  `id` int NOT NULL AUTO_INCREMENT,
  `target_id` int NOT NULL,
  `user_id` int NOT NULL,
  `hash` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `endDate` datetime NOT NULL,
  `dateAccess` datetime DEFAULT NULL,
  `keyId` varchar(9) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_5E0E2AA1158E0B66` (`target_id`),
  KEY `IDX_5E0E2AA1A76ED395` (`user_id`),
  CONSTRAINT `FK_5E0E2AA1158E0B66` FOREIGN KEY (`target_id`) REFERENCES `deeplink_target` (`id`),
  CONSTRAINT `FK_5E0E2AA1A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `deeplink`
--

INSERT INTO `deeplink` VALUES (1,1,1,'fa27aa5bbe91674','2022-08-12 10:02:01','2022-09-11 10:02:01','2022-08-12 10:09:05',NULL);

--
-- Table structure for table `deeplink_target`
--

CREATE TABLE `deeplink_target` (
  `id` int NOT NULL AUTO_INCREMENT,
  `target` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `route` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_6C55F005466F2FFC` (`target`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `deeplink_target`
--

INSERT INTO `deeplink_target` VALUES (1,'Homepage','home');

--
-- Table structure for table `equipment_category`
--

CREATE TABLE `equipment_category` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_368F9DE7999517A` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_category`
--


--
-- Table structure for table `equipment_category_type`
--

CREATE TABLE `equipment_category_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `category_id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `isSetupBasis` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_6750C84C999517A` (`name`),
  KEY `IDX_6750C84C12469DE2` (`category_id`),
  CONSTRAINT `FK_6750C84C12469DE2` FOREIGN KEY (`category_id`) REFERENCES `equipment_category` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_category_type`
--


--
-- Table structure for table `equipment_category_type_property`
--

CREATE TABLE `equipment_category_type_property` (
  `type_id` int NOT NULL,
  `property_id` int NOT NULL,
  PRIMARY KEY (`type_id`,`property_id`),
  KEY `IDX_2F3237AC54C8C93` (`type_id`),
  KEY `IDX_2F3237A549213EC` (`property_id`),
  CONSTRAINT `FK_2F3237A549213EC` FOREIGN KEY (`property_id`) REFERENCES `equipment_property` (`id`),
  CONSTRAINT `FK_2F3237AC54C8C93` FOREIGN KEY (`type_id`) REFERENCES `equipment_category_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_category_type_property`
--


--
-- Table structure for table `equipment_document`
--

CREATE TABLE `equipment_document` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `equipment_id` int NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `date_added` datetime NOT NULL,
  `filename` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_E8AA0E50A76ED395` (`user_id`),
  KEY `IDX_E8AA0E50517FE9FE` (`equipment_id`),
  CONSTRAINT `FK_E8AA0E50517FE9FE` FOREIGN KEY (`equipment_id`) REFERENCES `equipment_equipment` (`id`),
  CONSTRAINT `FK_E8AA0E50A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_document`
--


--
-- Table structure for table `equipment_equipment`
--

CREATE TABLE `equipment_equipment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `room_id` int DEFAULT NULL,
  `zone_id` int DEFAULT NULL,
  `area_id` int DEFAULT NULL,
  `label_id` int DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `MESName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `number` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `active` smallint NOT NULL,
  `activeInMES` smallint NOT NULL,
  `reservationPossible` int NOT NULL,
  `doubleBookingPossible` int NOT NULL,
  `reservationApprovalRequired` int NOT NULL,
  `calendarText` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `trainingPossible` int NOT NULL,
  `ownership` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `vendor` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `serialNumber` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `location` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `trainingDescription` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_10593FA47C3EB27` (`MESName`),
  KEY `IDX_10593FA54177093` (`room_id`),
  KEY `IDX_10593FA9F2C3FAB` (`zone_id`),
  KEY `IDX_10593FABD0F409C` (`area_id`),
  KEY `IDX_10593FA33B92F39` (`label_id`),
  CONSTRAINT `FK_10593FA33B92F39` FOREIGN KEY (`label_id`) REFERENCES `chemical_label` (`id`),
  CONSTRAINT `FK_10593FA54177093` FOREIGN KEY (`room_id`) REFERENCES `room_room` (`id`),
  CONSTRAINT `FK_10593FA9F2C3FAB` FOREIGN KEY (`zone_id`) REFERENCES `room_zone` (`id`),
  CONSTRAINT `FK_10593FABD0F409C` FOREIGN KEY (`area_id`) REFERENCES `location_area` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_equipment`
--


--
-- Table structure for table `equipment_equipment_category_type`
--

CREATE TABLE `equipment_equipment_category_type` (
  `equipment_id` int NOT NULL,
  `type_id` int NOT NULL,
  PRIMARY KEY (`equipment_id`,`type_id`),
  KEY `IDX_E3B4ACAF517FE9FE` (`equipment_id`),
  KEY `IDX_E3B4ACAFC54C8C93` (`type_id`),
  CONSTRAINT `FK_E3B4ACAF517FE9FE` FOREIGN KEY (`equipment_id`) REFERENCES `equipment_equipment` (`id`),
  CONSTRAINT `FK_E3B4ACAFC54C8C93` FOREIGN KEY (`type_id`) REFERENCES `equipment_category_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_equipment_category_type`
--


--
-- Table structure for table `equipment_equipment_document_file`
--

CREATE TABLE `equipment_equipment_document_file` (
  `id` int NOT NULL AUTO_INCREMENT,
  `document_id` int NOT NULL,
  `file` longblob NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_CFDA3B42C33F7837` (`document_id`),
  CONSTRAINT `FK_CFDA3B42C33F7837` FOREIGN KEY (`document_id`) REFERENCES `equipment_document` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_equipment_document_file`
--


--
-- Table structure for table `equipment_equipment_link`
--

CREATE TABLE `equipment_equipment_link` (
  `id` int NOT NULL AUTO_INCREMENT,
  `equipment_id` int NOT NULL,
  `type_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_D9281CF6517FE9FE` (`equipment_id`),
  KEY `IDX_D9281CF6C54C8C93` (`type_id`),
  CONSTRAINT `FK_D9281CF6517FE9FE` FOREIGN KEY (`equipment_id`) REFERENCES `equipment_equipment` (`id`),
  CONSTRAINT `FK_D9281CF6C54C8C93` FOREIGN KEY (`type_id`) REFERENCES `equipment_equipment_link_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_equipment_link`
--


--
-- Table structure for table `equipment_equipment_link_type`
--

CREATE TABLE `equipment_equipment_link_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_6AE403E6999517A` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_equipment_link_type`
--


--
-- Table structure for table `equipment_equipment_preventive_maintenance_maintenance`
--

CREATE TABLE `equipment_equipment_preventive_maintenance_maintenance` (
  `id` int NOT NULL AUTO_INCREMENT,
  `equipment_id` int NOT NULL,
  `schedule_id` int DEFAULT NULL,
  `reservation_id` int DEFAULT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `dateScheduled` datetime NOT NULL,
  `dateExecuted` datetime DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `actions` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_A26F49A6B83297E7` (`reservation_id`),
  KEY `IDX_A26F49A6517FE9FE` (`equipment_id`),
  KEY `IDX_A26F49A6A40BC2D5` (`schedule_id`),
  KEY `IDX_A26F49A6A76ED395` (`user_id`),
  CONSTRAINT `FK_A26F49A6517FE9FE` FOREIGN KEY (`equipment_id`) REFERENCES `equipment_equipment` (`id`),
  CONSTRAINT `FK_A26F49A6A40BC2D5` FOREIGN KEY (`schedule_id`) REFERENCES `equipment_equipment_preventive_maintenance_schedule` (`id`),
  CONSTRAINT `FK_A26F49A6A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_A26F49A6B83297E7` FOREIGN KEY (`reservation_id`) REFERENCES `equipment_reservation` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_equipment_preventive_maintenance_maintenance`
--


--
-- Table structure for table `equipment_equipment_preventive_maintenance_maintenance_file`
--

CREATE TABLE `equipment_equipment_preventive_maintenance_maintenance_file` (
  `id` int NOT NULL AUTO_INCREMENT,
  `maintenance_id` int NOT NULL,
  `file_id` int NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_177B69FCF6C202BC` (`maintenance_id`),
  KEY `IDX_177B69FC93CB796C` (`file_id`),
  CONSTRAINT `FK_177B69FC93CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`),
  CONSTRAINT `FK_177B69FCF6C202BC` FOREIGN KEY (`maintenance_id`) REFERENCES `equipment_equipment_preventive_maintenance_maintenance` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_equipment_preventive_maintenance_maintenance_file`
--


--
-- Table structure for table `equipment_equipment_preventive_maintenance_schedule`
--

CREATE TABLE `equipment_equipment_preventive_maintenance_schedule` (
  `id` int NOT NULL AUTO_INCREMENT,
  `equipment_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipmentInMaintenance` smallint NOT NULL,
  `actions` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `frequency` int NOT NULL,
  `plannedDaysInAdvance` int NOT NULL,
  `duration` int NOT NULL,
  `startHour` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_8BDA5A57517FE9FE` (`equipment_id`),
  CONSTRAINT `FK_8BDA5A57517FE9FE` FOREIGN KEY (`equipment_id`) REFERENCES `equipment_equipment` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_equipment_preventive_maintenance_schedule`
--


--
-- Table structure for table `equipment_equipment_preventive_maintenance_schedule_file`
--

CREATE TABLE `equipment_equipment_preventive_maintenance_schedule_file` (
  `id` int NOT NULL AUTO_INCREMENT,
  `schedule_id` int NOT NULL,
  `file_id` int NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_A7504B70A40BC2D5` (`schedule_id`),
  KEY `IDX_A7504B7093CB796C` (`file_id`),
  CONSTRAINT `FK_A7504B7093CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`),
  CONSTRAINT `FK_A7504B70A40BC2D5` FOREIGN KEY (`schedule_id`) REFERENCES `equipment_equipment_preventive_maintenance_schedule` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_equipment_preventive_maintenance_schedule_file`
--


--
-- Table structure for table `equipment_equipment_property`
--

CREATE TABLE `equipment_equipment_property` (
  `id` int NOT NULL AUTO_INCREMENT,
  `property_id` int NOT NULL,
  `equipment_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `value` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `valueArray` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci COMMENT '(DC2Type:array)',
  `valueInteger` int DEFAULT NULL,
  `valueDate` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_9E815FAA549213EC` (`property_id`),
  KEY `IDX_9E815FAA517FE9FE` (`equipment_id`),
  CONSTRAINT `FK_9E815FAA517FE9FE` FOREIGN KEY (`equipment_id`) REFERENCES `equipment_equipment` (`id`),
  CONSTRAINT `FK_9E815FAA549213EC` FOREIGN KEY (`property_id`) REFERENCES `equipment_property` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_equipment_property`
--


--
-- Table structure for table `equipment_equipment_request`
--

CREATE TABLE `equipment_equipment_request` (
  `id` int NOT NULL AUTO_INCREMENT,
  `equipment_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `reason` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `materials` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `frequency` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_92F9B2C2517FE9FE` (`equipment_id`),
  KEY `IDX_92F9B2C2A76ED395` (`user_id`),
  CONSTRAINT `FK_92F9B2C2517FE9FE` FOREIGN KEY (`equipment_id`) REFERENCES `equipment_equipment` (`id`),
  CONSTRAINT `FK_92F9B2C2A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_equipment_request`
--


--
-- Table structure for table `equipment_equipment_request_flow`
--

CREATE TABLE `equipment_equipment_request_flow` (
  `id` int NOT NULL AUTO_INCREMENT,
  `request_id` int NOT NULL,
  `user_id` int NOT NULL,
  `order` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_D2293B06427EB8A5` (`request_id`),
  KEY `IDX_D2293B06A76ED395` (`user_id`),
  CONSTRAINT `FK_D2293B06427EB8A5` FOREIGN KEY (`request_id`) REFERENCES `equipment_equipment_request` (`id`),
  CONSTRAINT `FK_D2293B06A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_equipment_request_flow`
--


--
-- Table structure for table `equipment_equipment_role`
--

CREATE TABLE `equipment_equipment_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `equipment_id` int NOT NULL,
  `user_id` int NOT NULL,
  `role_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  `inApprovalFlow` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_B8ED0F6D517FE9FED60322ACA76ED395` (`equipment_id`,`role_id`,`user_id`),
  KEY `IDX_B8ED0F6D517FE9FE` (`equipment_id`),
  KEY `IDX_B8ED0F6DA76ED395` (`user_id`),
  KEY `IDX_B8ED0F6DD60322AC` (`role_id`),
  CONSTRAINT `FK_B8ED0F6D517FE9FE` FOREIGN KEY (`equipment_id`) REFERENCES `equipment_equipment` (`id`),
  CONSTRAINT `FK_B8ED0F6DA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_B8ED0F6DD60322AC` FOREIGN KEY (`role_id`) REFERENCES `equipment_role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_equipment_role`
--


--
-- Table structure for table `equipment_equipment_user`
--

CREATE TABLE `equipment_equipment_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `equipment_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_6217534E517FE9FEA76ED395` (`equipment_id`,`user_id`),
  KEY `IDX_6217534E517FE9FE` (`equipment_id`),
  KEY `IDX_6217534EA76ED395` (`user_id`),
  CONSTRAINT `FK_6217534E517FE9FE` FOREIGN KEY (`equipment_id`) REFERENCES `equipment_equipment` (`id`),
  CONSTRAINT `FK_6217534EA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_equipment_user`
--


--
-- Table structure for table `equipment_file`
--

CREATE TABLE `equipment_file` (
  `equipment_id` int NOT NULL,
  `file_id` int NOT NULL,
  PRIMARY KEY (`equipment_id`,`file_id`),
  KEY `IDX_B61BE716517FE9FE` (`equipment_id`),
  KEY `IDX_B61BE71693CB796C` (`file_id`),
  CONSTRAINT `FK_B61BE716517FE9FE` FOREIGN KEY (`equipment_id`) REFERENCES `equipment_equipment` (`id`),
  CONSTRAINT `FK_B61BE71693CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_file`
--


--
-- Table structure for table `equipment_logging`
--

CREATE TABLE `equipment_logging` (
  `id` int NOT NULL AUTO_INCREMENT,
  `equipment_id` int NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fileName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fileData` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `separator` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mimeType` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `service_id` int DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_BCEEAD15517FE9FE` (`equipment_id`),
  KEY `IDX_BCEEAD15ED5CA9E6` (`service_id`),
  CONSTRAINT `FK_BCEEAD15517FE9FE` FOREIGN KEY (`equipment_id`) REFERENCES `equipment_equipment` (`id`),
  CONSTRAINT `FK_BCEEAD15ED5CA9E6` FOREIGN KEY (`service_id`) REFERENCES `equipment_logging_service` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_logging`
--


--
-- Table structure for table `equipment_logging_column`
--

CREATE TABLE `equipment_logging_column` (
  `id` int NOT NULL AUTO_INCREMENT,
  `logging_id` int NOT NULL,
  `parameter_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `column` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `startRow` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_D44459389BC5D12B8018C907D53877E` (`logging_id`,`startRow`,`column`),
  KEY `IDX_D44459389BC5D12` (`logging_id`),
  KEY `IDX_D44459387C56DBD6` (`parameter_id`),
  CONSTRAINT `FK_D44459387C56DBD6` FOREIGN KEY (`parameter_id`) REFERENCES `equipment_logging_parameter` (`id`),
  CONSTRAINT `FK_D44459389BC5D12` FOREIGN KEY (`logging_id`) REFERENCES `equipment_logging` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_logging_column`
--


--
-- Table structure for table `equipment_logging_direct_value`
--

CREATE TABLE `equipment_logging_direct_value` (
  `id` int NOT NULL AUTO_INCREMENT,
  `logging_id` int NOT NULL,
  `parameter_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `column` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `row` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_B3DCF009BC5D127D53877E8430F6DB` (`logging_id`,`column`,`row`),
  KEY `IDX_B3DCF009BC5D12` (`logging_id`),
  KEY `IDX_B3DCF007C56DBD6` (`parameter_id`),
  CONSTRAINT `FK_B3DCF007C56DBD6` FOREIGN KEY (`parameter_id`) REFERENCES `equipment_logging_parameter` (`id`),
  CONSTRAINT `FK_B3DCF009BC5D12` FOREIGN KEY (`logging_id`) REFERENCES `equipment_logging` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_logging_direct_value`
--


--
-- Table structure for table `equipment_logging_identifier_value`
--

CREATE TABLE `equipment_logging_identifier_value` (
  `id` int NOT NULL AUTO_INCREMENT,
  `logging_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `column` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `row` smallint NOT NULL,
  `value` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_3219B7CD9BC5D127D53877E8430F6DB` (`logging_id`,`column`,`row`),
  KEY `IDX_3219B7CD9BC5D12` (`logging_id`),
  CONSTRAINT `FK_3219B7CD9BC5D12` FOREIGN KEY (`logging_id`) REFERENCES `equipment_logging` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_logging_identifier_value`
--


--
-- Table structure for table `equipment_logging_parameter`
--

CREATE TABLE `equipment_logging_parameter` (
  `id` int NOT NULL AUTO_INCREMENT,
  `parameter_id` int DEFAULT NULL,
  `unit_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_C2E80D9D7C56DBD6` (`parameter_id`),
  KEY `IDX_C2E80D9DF8BD700D` (`unit_id`),
  CONSTRAINT `FK_C2E80D9D7C56DBD6` FOREIGN KEY (`parameter_id`) REFERENCES `process_parameter` (`id`),
  CONSTRAINT `FK_C2E80D9DF8BD700D` FOREIGN KEY (`unit_id`) REFERENCES `process_unit` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_logging_parameter`
--


--
-- Table structure for table `equipment_logging_service`
--

CREATE TABLE `equipment_logging_service` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `serverUrl` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `swaggerFile` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_logging_service`
--


--
-- Table structure for table `equipment_logging_service_method`
--

CREATE TABLE `equipment_logging_service_method` (
  `id` int NOT NULL AUTO_INCREMENT,
  `service_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `path` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `method` smallint NOT NULL,
  `responseContentType` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_177443E0ED5CA9E6` (`service_id`),
  CONSTRAINT `FK_177443E0ED5CA9E6` FOREIGN KEY (`service_id`) REFERENCES `equipment_logging_service` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_logging_service_method`
--


--
-- Table structure for table `equipment_logging_service_method_parameter`
--

CREATE TABLE `equipment_logging_service_method_parameter` (
  `id` int NOT NULL AUTO_INCREMENT,
  `method_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` smallint NOT NULL,
  `required` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_3D953F9419883967` (`method_id`),
  CONSTRAINT `FK_3D953F9419883967` FOREIGN KEY (`method_id`) REFERENCES `equipment_logging_service_method` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_logging_service_method_parameter`
--


--
-- Table structure for table `equipment_logging_service_processing_method`
--

CREATE TABLE `equipment_logging_service_processing_method` (
  `id` int NOT NULL AUTO_INCREMENT,
  `logging_id` int NOT NULL,
  `type` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `loggingServiceMethod_id` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_55F572CF9BC5D12` (`logging_id`),
  KEY `IDX_55F572CF80BAA12E` (`loggingServiceMethod_id`),
  CONSTRAINT `FK_55F572CF80BAA12E` FOREIGN KEY (`loggingServiceMethod_id`) REFERENCES `equipment_logging_service_method` (`id`),
  CONSTRAINT `FK_55F572CF9BC5D12` FOREIGN KEY (`logging_id`) REFERENCES `equipment_logging` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_logging_service_processing_method`
--


--
-- Table structure for table `equipment_logging_service_processing_method_parameter`
--

CREATE TABLE `equipment_logging_service_processing_method_parameter` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `value` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `serviceProcessingMethod_id` int NOT NULL,
  `loggingServiceMethodOptions_id` int DEFAULT NULL,
  `loggingServiceMethodParameter_id` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_F68C524CA29EECA0` (`serviceProcessingMethod_id`),
  KEY `IDX_F68C524C1DF2D356` (`loggingServiceMethodOptions_id`),
  KEY `IDX_F68C524CF2A0A130` (`loggingServiceMethodParameter_id`),
  CONSTRAINT `FK_F68C524C1DF2D356` FOREIGN KEY (`loggingServiceMethodOptions_id`) REFERENCES `equipment_logging_service_method` (`id`),
  CONSTRAINT `FK_F68C524CA29EECA0` FOREIGN KEY (`serviceProcessingMethod_id`) REFERENCES `equipment_logging_service_processing_method` (`id`),
  CONSTRAINT `FK_F68C524CF2A0A130` FOREIGN KEY (`loggingServiceMethodParameter_id`) REFERENCES `equipment_logging_service_method_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_logging_service_processing_method_parameter`
--


--
-- Table structure for table `equipment_logging_service_processing_method_result`
--

CREATE TABLE `equipment_logging_service_processing_method_result` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `resultIndex` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `resultType` smallint NOT NULL,
  `dataType` smallint NOT NULL,
  `serviceProcessingMethod_id` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_EAE14585A29EECA0` (`serviceProcessingMethod_id`),
  CONSTRAINT `FK_EAE14585A29EECA0` FOREIGN KEY (`serviceProcessingMethod_id`) REFERENCES `equipment_logging_service_processing_method` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_logging_service_processing_method_result`
--


--
-- Table structure for table `equipment_logging_service_processing_method_result_parameter`
--

CREATE TABLE `equipment_logging_service_processing_method_result_parameter` (
  `result_id` int NOT NULL,
  `parameter_id` int NOT NULL,
  PRIMARY KEY (`result_id`,`parameter_id`),
  KEY `IDX_1B8868A67A7B643` (`result_id`),
  KEY `IDX_1B8868A67C56DBD6` (`parameter_id`),
  CONSTRAINT `FK_1B8868A67A7B643` FOREIGN KEY (`result_id`) REFERENCES `equipment_logging_service_processing_method_result` (`id`),
  CONSTRAINT `FK_1B8868A67C56DBD6` FOREIGN KEY (`parameter_id`) REFERENCES `equipment_logging_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_logging_service_processing_method_result_parameter`
--


--
-- Table structure for table `equipment_module`
--

CREATE TABLE `equipment_module` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type_id` int NOT NULL,
  `equipment_id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `active` smallint NOT NULL,
  `reservationPossible` int NOT NULL,
  `MESName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_ABAA5968C54C8C93` (`type_id`),
  KEY `IDX_ABAA5968517FE9FE` (`equipment_id`),
  CONSTRAINT `FK_ABAA5968517FE9FE` FOREIGN KEY (`equipment_id`) REFERENCES `equipment_equipment` (`id`),
  CONSTRAINT `FK_ABAA5968C54C8C93` FOREIGN KEY (`type_id`) REFERENCES `equipment_module_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module`
--


--
-- Table structure for table `equipment_module_asset`
--

CREATE TABLE `equipment_module_asset` (
  `id` int NOT NULL AUTO_INCREMENT,
  `function_id` int NOT NULL,
  `module_id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_AEC8DDAD67048801` (`function_id`),
  KEY `IDX_AEC8DDADAFC2B591` (`module_id`),
  CONSTRAINT `FK_AEC8DDAD67048801` FOREIGN KEY (`function_id`) REFERENCES `equipment_module_asset_function` (`id`),
  CONSTRAINT `FK_AEC8DDADAFC2B591` FOREIGN KEY (`module_id`) REFERENCES `equipment_module` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_asset`
--


--
-- Table structure for table `equipment_module_asset_function`
--

CREATE TABLE `equipment_module_asset_function` (
  `id` int NOT NULL AUTO_INCREMENT,
  `function` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_B079F4591376147A` (`function`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_asset_function`
--


--
-- Table structure for table `equipment_module_changelog`
--

CREATE TABLE `equipment_module_changelog` (
  `id` int NOT NULL AUTO_INCREMENT,
  `module_id` int NOT NULL,
  `user_id` int NOT NULL,
  `runstep_id` int DEFAULT NULL,
  `runstep_checklist_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `message` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` smallint NOT NULL,
  `source` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_E73E4865AFC2B591` (`module_id`),
  KEY `IDX_E73E4865A76ED395` (`user_id`),
  KEY `IDX_E73E486580BDC822` (`runstep_id`),
  KEY `IDX_E73E4865F1964EA4` (`runstep_checklist_id`),
  CONSTRAINT `FK_E73E486580BDC822` FOREIGN KEY (`runstep_id`) REFERENCES `run_step` (`id`),
  CONSTRAINT `FK_E73E4865A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_E73E4865AFC2B591` FOREIGN KEY (`module_id`) REFERENCES `equipment_module` (`id`),
  CONSTRAINT `FK_E73E4865F1964EA4` FOREIGN KEY (`runstep_checklist_id`) REFERENCES `run_step_checklist` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_changelog`
--


--
-- Table structure for table `equipment_module_ecn`
--

CREATE TABLE `equipment_module_ecn` (
  `id` int NOT NULL AUTO_INCREMENT,
  `module_id` int NOT NULL,
  `user_id` int NOT NULL,
  `update_user_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `dateClosed` datetime DEFAULT NULL,
  `ecn` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_90FF59C8AFC2B591` (`module_id`),
  KEY `IDX_90FF59C8A76ED395` (`user_id`),
  KEY `IDX_90FF59C8E0DFCA6C` (`update_user_id`),
  CONSTRAINT `FK_90FF59C8A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_90FF59C8AFC2B591` FOREIGN KEY (`module_id`) REFERENCES `equipment_module` (`id`),
  CONSTRAINT `FK_90FF59C8E0DFCA6C` FOREIGN KEY (`update_user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_ecn`
--


--
-- Table structure for table `equipment_module_ecn_attachment`
--

CREATE TABLE `equipment_module_ecn_attachment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ecn_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `filename` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mimeType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fileSize` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_22B0F1CE7590AEC5` (`ecn_id`),
  CONSTRAINT `FK_22B0F1CE7590AEC5` FOREIGN KEY (`ecn_id`) REFERENCES `equipment_module_ecn` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_ecn_attachment`
--


--
-- Table structure for table `equipment_module_ecn_attachment_file`
--

CREATE TABLE `equipment_module_ecn_attachment_file` (
  `id` int NOT NULL AUTO_INCREMENT,
  `attachment_id` int NOT NULL,
  `file` longblob NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_DBA9D943464E68B` (`attachment_id`),
  CONSTRAINT `FK_DBA9D943464E68B` FOREIGN KEY (`attachment_id`) REFERENCES `equipment_module_ecn_attachment` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_ecn_attachment_file`
--


--
-- Table structure for table `equipment_module_facility`
--

CREATE TABLE `equipment_module_facility` (
  `id` int NOT NULL AUTO_INCREMENT,
  `facility_id` int NOT NULL,
  `module_id` int NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_34B778EA7014910` (`facility_id`),
  KEY `IDX_34B778EAFC2B591` (`module_id`),
  CONSTRAINT `FK_34B778EA7014910` FOREIGN KEY (`facility_id`) REFERENCES `facility_facility` (`id`),
  CONSTRAINT `FK_34B778EAFC2B591` FOREIGN KEY (`module_id`) REFERENCES `equipment_module` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_facility`
--


--
-- Table structure for table `equipment_module_issue`
--

CREATE TABLE `equipment_module_issue` (
  `id` int NOT NULL AUTO_INCREMENT,
  `module_id` int NOT NULL,
  `user_id` int NOT NULL,
  `update_user_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `dateClosed` datetime DEFAULT NULL,
  `status` smallint NOT NULL,
  `issueType` smallint NOT NULL,
  `issue` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `actions` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `forecastUp` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_BECAA4CFAFC2B591` (`module_id`),
  KEY `IDX_BECAA4CFA76ED395` (`user_id`),
  KEY `IDX_BECAA4CFE0DFCA6C` (`update_user_id`),
  CONSTRAINT `FK_BECAA4CFA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_BECAA4CFAFC2B591` FOREIGN KEY (`module_id`) REFERENCES `equipment_module` (`id`),
  CONSTRAINT `FK_BECAA4CFE0DFCA6C` FOREIGN KEY (`update_user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_issue`
--


--
-- Table structure for table `equipment_module_issue_attachment`
--

CREATE TABLE `equipment_module_issue_attachment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `issue_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `filename` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mimeType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fileSize` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_6663169D5E7AA58C` (`issue_id`),
  CONSTRAINT `FK_6663169D5E7AA58C` FOREIGN KEY (`issue_id`) REFERENCES `equipment_module_issue` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_issue_attachment`
--


--
-- Table structure for table `equipment_module_issue_attachment_file`
--

CREATE TABLE `equipment_module_issue_attachment_file` (
  `id` int NOT NULL AUTO_INCREMENT,
  `attachment_id` int NOT NULL,
  `file` longblob NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_F46814B1464E68B` (`attachment_id`),
  CONSTRAINT `FK_F46814B1464E68B` FOREIGN KEY (`attachment_id`) REFERENCES `equipment_module_issue_attachment` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_issue_attachment_file`
--


--
-- Table structure for table `equipment_module_parameter`
--

CREATE TABLE `equipment_module_parameter` (
  `id` int NOT NULL AUTO_INCREMENT,
  `module_id` int NOT NULL,
  `parameter_id` int NOT NULL,
  `unit_id` int DEFAULT NULL,
  `fixRange` smallint NOT NULL,
  `showInName` smallint NOT NULL,
  `required` smallint NOT NULL,
  `header` smallint NOT NULL,
  `locked` smallint NOT NULL,
  `minValue` double DEFAULT NULL,
  `maxValue` double DEFAULT NULL,
  `value` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sequence` int NOT NULL,
  `visibility` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_5EBFF74AFC2B591` (`module_id`),
  KEY `IDX_5EBFF747C56DBD6` (`parameter_id`),
  KEY `IDX_5EBFF74F8BD700D` (`unit_id`),
  CONSTRAINT `FK_5EBFF747C56DBD6` FOREIGN KEY (`parameter_id`) REFERENCES `process_parameter` (`id`),
  CONSTRAINT `FK_5EBFF74AFC2B591` FOREIGN KEY (`module_id`) REFERENCES `equipment_module` (`id`),
  CONSTRAINT `FK_5EBFF74F8BD700D` FOREIGN KEY (`unit_id`) REFERENCES `process_unit` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_parameter`
--


--
-- Table structure for table `equipment_module_parameter_value`
--

CREATE TABLE `equipment_module_parameter_value` (
  `id` int NOT NULL AUTO_INCREMENT,
  `value` varchar(1000) COLLATE utf8mb3_unicode_ci NOT NULL,
  `moduleParameter_id` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_CA2D3821B4F1B802` (`moduleParameter_id`),
  CONSTRAINT `FK_CA2D3821B4F1B802` FOREIGN KEY (`moduleParameter_id`) REFERENCES `equipment_module_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_parameter_value`
--


--
-- Table structure for table `equipment_module_status`
--

CREATE TABLE `equipment_module_status` (
  `id` int NOT NULL AUTO_INCREMENT,
  `module_id` int NOT NULL,
  `status_id` int NOT NULL,
  `user_id` int NOT NULL,
  `active` smallint NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_B116C011AFC2B591` (`module_id`),
  KEY `IDX_B116C0116BF700BD` (`status_id`),
  KEY `IDX_B116C011A76ED395` (`user_id`),
  CONSTRAINT `FK_B116C0116BF700BD` FOREIGN KEY (`status_id`) REFERENCES `equipment_status` (`id`),
  CONSTRAINT `FK_B116C011A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_B116C011AFC2B591` FOREIGN KEY (`module_id`) REFERENCES `equipment_module` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_status`
--


--
-- Table structure for table `equipment_module_status_attachment`
--

CREATE TABLE `equipment_module_status_attachment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `status_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `filename` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mimeType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fileSize` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_C855D1AB6BF700BD` (`status_id`),
  CONSTRAINT `FK_C855D1AB6BF700BD` FOREIGN KEY (`status_id`) REFERENCES `equipment_module_status` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_status_attachment`
--


--
-- Table structure for table `equipment_module_status_attachment_file`
--

CREATE TABLE `equipment_module_status_attachment_file` (
  `id` int NOT NULL AUTO_INCREMENT,
  `attachment_id` int NOT NULL,
  `file` longblob NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_21F1876D464E68B` (`attachment_id`),
  CONSTRAINT `FK_21F1876D464E68B` FOREIGN KEY (`attachment_id`) REFERENCES `equipment_module_status_attachment` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_status_attachment_file`
--


--
-- Table structure for table `equipment_module_type`
--

CREATE TABLE `equipment_module_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_57A0E6028CDE5729` (`type`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_module_type`
--

INSERT INTO `equipment_module_type` VALUES (1,'Load port','2022-08-12 10:33:20','2022-08-12 10:33:20'),(2,'Main tool','2022-08-12 10:33:38','2022-08-12 10:33:38'),(3,'Process module','2022-08-12 10:33:48','2022-08-12 10:33:48'),(4,'Transport module','2022-08-12 10:33:58','2022-08-12 10:33:58'),(5,'Battery channel','2022-08-12 11:12:07','2022-08-12 11:12:07'),(6,'Measurement Chuck','2022-08-12 11:12:22','2022-08-12 11:12:22');

--
-- Table structure for table `equipment_monitor`
--

CREATE TABLE `equipment_monitor` (
  `id` int NOT NULL AUTO_INCREMENT,
  `project_id` int DEFAULT NULL,
  `user_id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `frequency` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` smallint NOT NULL,
  `type` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_976E566A166D1F9C` (`project_id`),
  KEY `IDX_976E566AA76ED395` (`user_id`),
  CONSTRAINT `FK_976E566A166D1F9C` FOREIGN KEY (`project_id`) REFERENCES `organisation_project` (`id`),
  CONSTRAINT `FK_976E566AA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor`
--


--
-- Table structure for table `equipment_monitor_changelog`
--

CREATE TABLE `equipment_monitor_changelog` (
  `id` int NOT NULL AUTO_INCREMENT,
  `monitor_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `message` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_AD5DD1624CE1C902` (`monitor_id`),
  KEY `IDX_AD5DD162A76ED395` (`user_id`),
  CONSTRAINT `FK_AD5DD1624CE1C902` FOREIGN KEY (`monitor_id`) REFERENCES `equipment_monitor` (`id`),
  CONSTRAINT `FK_AD5DD162A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_changelog`
--


--
-- Table structure for table `equipment_monitor_file_file`
--

CREATE TABLE `equipment_monitor_file_file` (
  `monitor_id` int NOT NULL,
  `file_id` int NOT NULL,
  PRIMARY KEY (`monitor_id`,`file_id`),
  KEY `IDX_607CA91D4CE1C902` (`monitor_id`),
  KEY `IDX_607CA91D93CB796C` (`file_id`),
  CONSTRAINT `FK_607CA91D4CE1C902` FOREIGN KEY (`monitor_id`) REFERENCES `equipment_monitor` (`id`),
  CONSTRAINT `FK_607CA91D93CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_file_file`
--


--
-- Table structure for table `equipment_monitor_measurement`
--

CREATE TABLE `equipment_monitor_measurement` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `sequence` int NOT NULL,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `definition` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `method` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `resultType` smallint NOT NULL,
  `requirement_id` int DEFAULT NULL,
  `loggingParameter_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_41E9E2D573B21E9C` (`step_id`),
  UNIQUE KEY `UNIQ_41E9E2D57B576F77` (`requirement_id`),
  KEY `IDX_41E9E2D5C80EE3D9` (`loggingParameter_id`),
  CONSTRAINT `FK_41E9E2D573B21E9C` FOREIGN KEY (`step_id`) REFERENCES `equipment_monitor_step` (`id`),
  CONSTRAINT `FK_41E9E2D57B576F77` FOREIGN KEY (`requirement_id`) REFERENCES `equipment_monitor_requirement` (`id`),
  CONSTRAINT `FK_41E9E2D5C80EE3D9` FOREIGN KEY (`loggingParameter_id`) REFERENCES `equipment_logging_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_measurement`
--


--
-- Table structure for table `equipment_monitor_measurement_label`
--

CREATE TABLE `equipment_monitor_measurement_label` (
  `id` int NOT NULL AUTO_INCREMENT,
  `measurement_id` int NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `open` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_4E574C12924EA134` (`measurement_id`),
  CONSTRAINT `FK_4E574C12924EA134` FOREIGN KEY (`measurement_id`) REFERENCES `equipment_monitor_measurement` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_measurement_label`
--


--
-- Table structure for table `equipment_monitor_requirement`
--

CREATE TABLE `equipment_monitor_requirement` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `requirement_step_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `sequence` int NOT NULL,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `definition` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `method` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `minValue` double DEFAULT NULL,
  `maxValue` double DEFAULT NULL,
  `target` double DEFAULT NULL,
  `inclusive` smallint NOT NULL,
  `unit` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `loggingParameter_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_B6366F9473B21E9C` (`step_id`),
  KEY `IDX_B6366F9428383107` (`requirement_step_id`),
  KEY `IDX_B6366F94C80EE3D9` (`loggingParameter_id`),
  CONSTRAINT `FK_B6366F9428383107` FOREIGN KEY (`requirement_step_id`) REFERENCES `equipment_monitor_step` (`id`),
  CONSTRAINT `FK_B6366F9473B21E9C` FOREIGN KEY (`step_id`) REFERENCES `equipment_monitor_step` (`id`),
  CONSTRAINT `FK_B6366F94C80EE3D9` FOREIGN KEY (`loggingParameter_id`) REFERENCES `equipment_logging_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_requirement`
--


--
-- Table structure for table `equipment_monitor_requirement_label`
--

CREATE TABLE `equipment_monitor_requirement_label` (
  `id` int NOT NULL AUTO_INCREMENT,
  `requirement_id` int NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `open` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_D992D627B576F77` (`requirement_id`),
  CONSTRAINT `FK_D992D627B576F77` FOREIGN KEY (`requirement_id`) REFERENCES `equipment_monitor_requirement` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_requirement_label`
--


--
-- Table structure for table `equipment_monitor_run`
--

CREATE TABLE `equipment_monitor_run` (
  `id` int NOT NULL AUTO_INCREMENT,
  `monitor_id` int NOT NULL,
  `run_id` int NOT NULL,
  `schedule_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_B4A2B89184E3FEC4` (`run_id`),
  KEY `IDX_B4A2B8914CE1C902` (`monitor_id`),
  KEY `IDX_B4A2B891A40BC2D5` (`schedule_id`),
  CONSTRAINT `FK_B4A2B8914CE1C902` FOREIGN KEY (`monitor_id`) REFERENCES `equipment_monitor` (`id`),
  CONSTRAINT `FK_B4A2B89184E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`),
  CONSTRAINT `FK_B4A2B891A40BC2D5` FOREIGN KEY (`schedule_id`) REFERENCES `equipment_monitor_schedule` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_run`
--


--
-- Table structure for table `equipment_monitor_schedule`
--

CREATE TABLE `equipment_monitor_schedule` (
  `id` int NOT NULL AUTO_INCREMENT,
  `monitor_id` int NOT NULL,
  `project_id` int NOT NULL,
  `team_id` int NOT NULL,
  `group_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `parts` smallint NOT NULL,
  `actions` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `frequency` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_F516B4A34CE1C902` (`monitor_id`),
  KEY `IDX_F516B4A3166D1F9C` (`project_id`),
  KEY `IDX_F516B4A3296CD8AE` (`team_id`),
  KEY `IDX_F516B4A3FE54D947` (`group_id`),
  CONSTRAINT `FK_F516B4A3166D1F9C` FOREIGN KEY (`project_id`) REFERENCES `organisation_project` (`id`),
  CONSTRAINT `FK_F516B4A3296CD8AE` FOREIGN KEY (`team_id`) REFERENCES `organisation_team` (`id`),
  CONSTRAINT `FK_F516B4A34CE1C902` FOREIGN KEY (`monitor_id`) REFERENCES `equipment_monitor` (`id`),
  CONSTRAINT `FK_F516B4A3FE54D947` FOREIGN KEY (`group_id`) REFERENCES `organisation_group` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_schedule`
--


--
-- Table structure for table `equipment_monitor_step`
--

CREATE TABLE `equipment_monitor_step` (
  `id` int NOT NULL AUTO_INCREMENT,
  `monitor_id` int NOT NULL,
  `user_id` int NOT NULL,
  `processmodule_id` int NOT NULL,
  `stepgroup_id` int DEFAULT NULL,
  `process_module_recipe_version_id` int DEFAULT NULL,
  `sequence` int NOT NULL,
  `number` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `subSteps` int NOT NULL,
  `isMonitored` smallint NOT NULL,
  `remark` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `instructions` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `processName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_5F314B424CE1C902` (`monitor_id`),
  KEY `IDX_5F314B42A76ED395` (`user_id`),
  KEY `IDX_5F314B4277F3AE70` (`processmodule_id`),
  KEY `IDX_5F314B423AE1BED5` (`stepgroup_id`),
  KEY `IDX_5F314B42540BA1EB` (`process_module_recipe_version_id`),
  CONSTRAINT `FK_5F314B423AE1BED5` FOREIGN KEY (`stepgroup_id`) REFERENCES `equipment_monitor_step_group` (`id`),
  CONSTRAINT `FK_5F314B424CE1C902` FOREIGN KEY (`monitor_id`) REFERENCES `equipment_monitor` (`id`),
  CONSTRAINT `FK_5F314B42540BA1EB` FOREIGN KEY (`process_module_recipe_version_id`) REFERENCES `process_module_recipe_version` (`id`),
  CONSTRAINT `FK_5F314B4277F3AE70` FOREIGN KEY (`processmodule_id`) REFERENCES `process_module` (`id`),
  CONSTRAINT `FK_5F314B42A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_step`
--


--
-- Table structure for table `equipment_monitor_step_file`
--

CREATE TABLE `equipment_monitor_step_file` (
  `step_id` int NOT NULL,
  `file_id` int NOT NULL,
  PRIMARY KEY (`step_id`,`file_id`),
  KEY `IDX_A7165C2273B21E9C` (`step_id`),
  KEY `IDX_A7165C2293CB796C` (`file_id`),
  CONSTRAINT `FK_A7165C2273B21E9C` FOREIGN KEY (`step_id`) REFERENCES `equipment_monitor_step` (`id`),
  CONSTRAINT `FK_A7165C2293CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_step_file`
--


--
-- Table structure for table `equipment_monitor_step_group`
--

CREATE TABLE `equipment_monitor_step_group` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `locked` smallint NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_step_group`
--


--
-- Table structure for table `equipment_monitor_step_label`
--

CREATE TABLE `equipment_monitor_step_label` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `open` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_C65B880273B21E9C` (`step_id`),
  CONSTRAINT `FK_C65B880273B21E9C` FOREIGN KEY (`step_id`) REFERENCES `equipment_monitor_step` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_step_label`
--


--
-- Table structure for table `equipment_monitor_step_parameter`
--

CREATE TABLE `equipment_monitor_step_parameter` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `parameter_id` int NOT NULL,
  `unit_id` int DEFAULT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `version` int NOT NULL,
  `sequence` int NOT NULL,
  `showInName` smallint NOT NULL,
  `required` smallint NOT NULL,
  `header` smallint NOT NULL,
  `locked` smallint NOT NULL,
  `visibility` smallint NOT NULL,
  `fixRange` smallint NOT NULL,
  `minValue` double DEFAULT NULL,
  `maxValue` double DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_3D79B0F773B21E9C` (`step_id`),
  KEY `IDX_3D79B0F77C56DBD6` (`parameter_id`),
  KEY `IDX_3D79B0F7F8BD700D` (`unit_id`),
  CONSTRAINT `FK_3D79B0F773B21E9C` FOREIGN KEY (`step_id`) REFERENCES `equipment_monitor_step` (`id`),
  CONSTRAINT `FK_3D79B0F77C56DBD6` FOREIGN KEY (`parameter_id`) REFERENCES `process_parameter` (`id`),
  CONSTRAINT `FK_3D79B0F7F8BD700D` FOREIGN KEY (`unit_id`) REFERENCES `process_unit` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_step_parameter`
--


--
-- Table structure for table `equipment_monitor_step_parameter_value`
--

CREATE TABLE `equipment_monitor_step_parameter_value` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_parameter_id` int NOT NULL,
  `value` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sequence` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_B59B0CC847392C04` (`step_parameter_id`),
  CONSTRAINT `FK_B59B0CC847392C04` FOREIGN KEY (`step_parameter_id`) REFERENCES `equipment_monitor_step_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_step_parameter_value`
--


--
-- Table structure for table `equipment_monitor_step_tag`
--

CREATE TABLE `equipment_monitor_step_tag` (
  `step_id` int NOT NULL,
  `tag_id` int NOT NULL,
  PRIMARY KEY (`step_id`,`tag_id`),
  KEY `IDX_3EB9173973B21E9C` (`step_id`),
  KEY `IDX_3EB91739BAD26311` (`tag_id`),
  CONSTRAINT `FK_3EB9173973B21E9C` FOREIGN KEY (`step_id`) REFERENCES `equipment_monitor_step` (`id`),
  CONSTRAINT `FK_3EB91739BAD26311` FOREIGN KEY (`tag_id`) REFERENCES `organisation_project_tag` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_step_tag`
--


--
-- Table structure for table `equipment_monitor_user`
--

CREATE TABLE `equipment_monitor_user` (
  `monitor_id` int NOT NULL,
  `user_id` int NOT NULL,
  PRIMARY KEY (`monitor_id`,`user_id`),
  KEY `IDX_911B63374CE1C902` (`monitor_id`),
  KEY `IDX_911B6337A76ED395` (`user_id`),
  CONSTRAINT `FK_911B63374CE1C902` FOREIGN KEY (`monitor_id`) REFERENCES `equipment_monitor` (`id`),
  CONSTRAINT `FK_911B6337A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_user`
--


--
-- Table structure for table `equipment_monitor_variable`
--

CREATE TABLE `equipment_monitor_variable` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `stepParameterValue_id` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_636322D5569A494C` (`stepParameterValue_id`),
  CONSTRAINT `FK_636322D5569A494C` FOREIGN KEY (`stepParameterValue_id`) REFERENCES `equipment_monitor_step_parameter_value` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_monitor_variable`
--


--
-- Table structure for table `equipment_property`
--

CREATE TABLE `equipment_property` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `showInList` smallint NOT NULL,
  `property` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `label` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `values` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `sort` smallint NOT NULL,
  `friendlyText` longtext COLLATE utf8mb3_unicode_ci NOT NULL,
  `defaultValue` longtext COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_BB3198F88BF21CDE` (`property`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_property`
--


--
-- Table structure for table `equipment_reservation`
--

CREATE TABLE `equipment_reservation` (
  `id` int NOT NULL AUTO_INCREMENT,
  `recurring_link_id` int DEFAULT NULL,
  `user_id` int NOT NULL,
  `equipment_id` int NOT NULL,
  `run_id` int DEFAULT NULL,
  `block_id` int DEFAULT NULL,
  `startDate` datetime NOT NULL,
  `endDate` datetime NOT NULL,
  `dateApproved` datetime DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `recurring` smallint NOT NULL,
  `recurringEndDate` datetime DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_238ABD72755297F8` (`recurring_link_id`),
  KEY `IDX_238ABD72A76ED395` (`user_id`),
  KEY `IDX_238ABD72517FE9FE` (`equipment_id`),
  KEY `IDX_238ABD7284E3FEC4` (`run_id`),
  KEY `IDX_238ABD72E9ED820C` (`block_id`),
  CONSTRAINT `FK_238ABD72517FE9FE` FOREIGN KEY (`equipment_id`) REFERENCES `equipment_equipment` (`id`),
  CONSTRAINT `FK_238ABD72755297F8` FOREIGN KEY (`recurring_link_id`) REFERENCES `equipment_reservation` (`id`),
  CONSTRAINT `FK_238ABD7284E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`),
  CONSTRAINT `FK_238ABD72A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_238ABD72E9ED820C` FOREIGN KEY (`block_id`) REFERENCES `equipment_reservation_block` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_reservation`
--


--
-- Table structure for table `equipment_reservation_block`
--

CREATE TABLE `equipment_reservation_block` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_1F71B537A76ED395` (`user_id`),
  CONSTRAINT `FK_1F71B537A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_reservation_block`
--


--
-- Table structure for table `equipment_reservation_module`
--

CREATE TABLE `equipment_reservation_module` (
  `reservation_id` int NOT NULL,
  `module_id` int NOT NULL,
  PRIMARY KEY (`reservation_id`,`module_id`),
  KEY `IDX_6165A8E1B83297E7` (`reservation_id`),
  KEY `IDX_6165A8E1AFC2B591` (`module_id`),
  CONSTRAINT `FK_6165A8E1AFC2B591` FOREIGN KEY (`module_id`) REFERENCES `equipment_module` (`id`),
  CONSTRAINT `FK_6165A8E1B83297E7` FOREIGN KEY (`reservation_id`) REFERENCES `equipment_reservation` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_reservation_module`
--


--
-- Table structure for table `equipment_reservation_module_asset`
--

CREATE TABLE `equipment_reservation_module_asset` (
  `reservation_id` int NOT NULL,
  `asset_id` int NOT NULL,
  PRIMARY KEY (`reservation_id`,`asset_id`),
  KEY `IDX_50350C96B83297E7` (`reservation_id`),
  KEY `IDX_50350C965DA1941` (`asset_id`),
  CONSTRAINT `FK_50350C965DA1941` FOREIGN KEY (`asset_id`) REFERENCES `equipment_module_asset` (`id`),
  CONSTRAINT `FK_50350C96B83297E7` FOREIGN KEY (`reservation_id`) REFERENCES `equipment_reservation` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_reservation_module_asset`
--


--
-- Table structure for table `equipment_role`
--

CREATE TABLE `equipment_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `sequence` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_role`
--

INSERT INTO `equipment_role` VALUES (1,'BSV','Basis stap verantwoordelijke',1),(2,'HW','Hardware Engineer',2),(3,'PE','Proces Engineer',3),(4,'TR','Training Responsible',4),(5,'TE','the engineer responsible for the tool',5),(6,'TO','Operator of the tool',6);

--
-- Table structure for table `equipment_setup`
--

CREATE TABLE `equipment_setup` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `zone_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8mb3_unicode_ci NOT NULL,
  `endDate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_CC4477D4A76ED395` (`user_id`),
  KEY `IDX_CC4477D49F2C3FAB` (`zone_id`),
  CONSTRAINT `FK_CC4477D49F2C3FAB` FOREIGN KEY (`zone_id`) REFERENCES `room_zone` (`id`),
  CONSTRAINT `FK_CC4477D4A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_setup`
--


--
-- Table structure for table `equipment_setup_equipment`
--

CREATE TABLE `equipment_setup_equipment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `setup_id` int NOT NULL,
  `equipment_id` int NOT NULL,
  `title` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `dateEnd` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_FAF6CC59CDCDB68E` (`setup_id`),
  KEY `IDX_FAF6CC59517FE9FE` (`equipment_id`),
  CONSTRAINT `FK_FAF6CC59517FE9FE` FOREIGN KEY (`equipment_id`) REFERENCES `equipment_equipment` (`id`),
  CONSTRAINT `FK_FAF6CC59CDCDB68E` FOREIGN KEY (`setup_id`) REFERENCES `equipment_setup` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_setup_equipment`
--


--
-- Table structure for table `equipment_status`
--

CREATE TABLE `equipment_status` (
  `id` int NOT NULL AUTO_INCREMENT,
  `status` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `frontColor` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `backColor` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `sequence` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_status`
--

INSERT INTO `equipment_status` VALUES (1,'IDLE_ERROR','#ffffff','#fe0201','2022-08-12 10:11:31','2022-08-12 10:11:31',0),(2,'IN_REPAIR','#ffffff','#fe0201','2022-08-12 10:12:55','2022-08-12 10:12:55',0),(3,'MAINTENANCE','#ffffff','#ffc003','2022-08-12 10:14:50','2022-08-12 10:14:50',0),(4,'PARTLY_UP','#ffffff','#548234','2022-08-12 10:16:42','2022-08-12 10:16:42',0),(5,'RESERVED','#ffffff','#181cec','2022-08-12 10:18:06','2022-08-12 10:28:51',0),(6,'SETUP','#ffffff','#f28e1c','2022-08-12 10:20:28','2022-08-12 10:20:28',0),(7,'SPC_TEST','#ffffff','#ec7d31','2022-08-12 10:22:45','2022-08-12 10:22:46',0),(8,'UP','#ffffff','#93cf50','2022-08-12 10:23:12','2022-08-12 10:23:12',0);

--
-- Table structure for table `equipment_statusmail`
--

CREATE TABLE `equipment_statusmail` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `filter` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci COMMENT '(DC2Type:array)',
  `sequence` int NOT NULL,
  `showIssuesWithPriority` smallint NOT NULL,
  `showInNavigation` smallint NOT NULL,
  `showToolUp` smallint NOT NULL,
  `showIssues` smallint NOT NULL,
  `showReservations` smallint NOT NULL,
  `classification` smallint NOT NULL,
  `default` smallint NOT NULL,
  `order` smallint NOT NULL,
  `direction` smallint NOT NULL,
  `to` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cc` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `bcc` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `subject` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_EB2911CEA76ED395` (`user_id`),
  CONSTRAINT `FK_EB2911CEA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment_statusmail`
--


--
-- Table structure for table `facility_facility`
--

CREATE TABLE `facility_facility` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type_id` int NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `information` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `active` smallint NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `number` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_465A2D3DC54C8C93` (`type_id`),
  CONSTRAINT `FK_465A2D3DC54C8C93` FOREIGN KEY (`type_id`) REFERENCES `facility_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `facility_facility`
--


--
-- Table structure for table `facility_facility_file`
--

CREATE TABLE `facility_facility_file` (
  `facility_id` int NOT NULL,
  `file_id` int NOT NULL,
  PRIMARY KEY (`facility_id`,`file_id`),
  KEY `IDX_1D5B0E3AA7014910` (`facility_id`),
  KEY `IDX_1D5B0E3A93CB796C` (`file_id`),
  CONSTRAINT `FK_1D5B0E3A93CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`),
  CONSTRAINT `FK_1D5B0E3AA7014910` FOREIGN KEY (`facility_id`) REFERENCES `facility_facility` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `facility_facility_file`
--


--
-- Table structure for table `facility_facility_preventive_maintenance_maintenance`
--

CREATE TABLE `facility_facility_preventive_maintenance_maintenance` (
  `id` int NOT NULL AUTO_INCREMENT,
  `facility_id` int NOT NULL,
  `schedule_id` int DEFAULT NULL,
  `user_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `dateScheduled` datetime NOT NULL,
  `dateExecuted` datetime DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `actions` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_C24748DBA7014910` (`facility_id`),
  KEY `IDX_C24748DBA40BC2D5` (`schedule_id`),
  KEY `IDX_C24748DBA76ED395` (`user_id`),
  CONSTRAINT `FK_C24748DBA40BC2D5` FOREIGN KEY (`schedule_id`) REFERENCES `facility_facility_preventive_maintenance_schedule` (`id`),
  CONSTRAINT `FK_C24748DBA7014910` FOREIGN KEY (`facility_id`) REFERENCES `facility_facility` (`id`),
  CONSTRAINT `FK_C24748DBA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `facility_facility_preventive_maintenance_maintenance`
--


--
-- Table structure for table `facility_facility_preventive_maintenance_schedule`
--

CREATE TABLE `facility_facility_preventive_maintenance_schedule` (
  `id` int NOT NULL AUTO_INCREMENT,
  `facility_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `actions` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `frequency` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_6BE21AADA7014910` (`facility_id`),
  CONSTRAINT `FK_6BE21AADA7014910` FOREIGN KEY (`facility_id`) REFERENCES `facility_facility` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `facility_facility_preventive_maintenance_schedule`
--


--
-- Table structure for table `facility_facility_property`
--

CREATE TABLE `facility_facility_property` (
  `id` int NOT NULL AUTO_INCREMENT,
  `property_id` int NOT NULL,
  `facility_id` int NOT NULL,
  `value` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `valueArray` longtext COLLATE utf8mb3_unicode_ci COMMENT '(DC2Type:array)',
  `valueInteger` int DEFAULT NULL,
  `valueDate` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_469B5634549213EC` (`property_id`),
  KEY `IDX_469B5634A7014910` (`facility_id`),
  CONSTRAINT `FK_469B5634549213EC` FOREIGN KEY (`property_id`) REFERENCES `facility_property` (`id`),
  CONSTRAINT `FK_469B5634A7014910` FOREIGN KEY (`facility_id`) REFERENCES `facility_facility` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `facility_facility_property`
--


--
-- Table structure for table `facility_facility_status`
--

CREATE TABLE `facility_facility_status` (
  `id` int NOT NULL AUTO_INCREMENT,
  `facility_id` int NOT NULL,
  `status_id` int NOT NULL,
  `user_id` int NOT NULL,
  `isActive` tinyint(1) NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_3C69806EA7014910` (`facility_id`),
  KEY `IDX_3C69806E6BF700BD` (`status_id`),
  KEY `IDX_3C69806EA76ED395` (`user_id`),
  CONSTRAINT `FK_3C69806E6BF700BD` FOREIGN KEY (`status_id`) REFERENCES `facility_status` (`id`),
  CONSTRAINT `FK_3C69806EA7014910` FOREIGN KEY (`facility_id`) REFERENCES `facility_facility` (`id`),
  CONSTRAINT `FK_3C69806EA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `facility_facility_status`
--


--
-- Table structure for table `facility_property`
--

CREATE TABLE `facility_property` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `property` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `label` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `showInList` smallint NOT NULL,
  `values` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `unit` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sort` smallint NOT NULL,
  `friendlyText` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `defaultValue` longtext COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `facility_property`
--


--
-- Table structure for table `facility_status`
--

CREATE TABLE `facility_status` (
  `id` int NOT NULL AUTO_INCREMENT,
  `status` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `frontColor` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `backColor` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `facility_status`
--

INSERT INTO `facility_status` VALUES (1,'IDLE_ERROR','#ffffff','#fe0201','2022-08-12 10:35:14','2022-08-12 10:35:14'),(2,'IN_REPAIR','#ffffff','#fe0201','2022-08-12 10:35:58','2022-08-12 10:35:58'),(3,'MAINTENANCE','#ffffff','#ffc003','2022-08-12 10:36:39','2022-08-12 10:36:39'),(4,'UP','#ffffff','#93cf50','2022-08-12 10:38:18','2022-08-12 10:39:01');

--
-- Table structure for table `facility_type`
--

CREATE TABLE `facility_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `color` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_A0710DDB5E237E06` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `facility_type`
--


--
-- Table structure for table `facility_type_property`
--

CREATE TABLE `facility_type_property` (
  `type_id` int NOT NULL,
  `property_id` int NOT NULL,
  PRIMARY KEY (`type_id`,`property_id`),
  KEY `IDX_FB6659FAC54C8C93` (`type_id`),
  KEY `IDX_FB6659FA549213EC` (`property_id`),
  CONSTRAINT `FK_FB6659FA549213EC` FOREIGN KEY (`property_id`) REFERENCES `facility_property` (`id`),
  CONSTRAINT `FK_FB6659FAC54C8C93` FOREIGN KEY (`type_id`) REFERENCES `facility_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `facility_type_property`
--


--
-- Table structure for table `file_download`
--

CREATE TABLE `file_download` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `file_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_C94A0DEDA76ED395` (`user_id`),
  KEY `IDX_C94A0DED93CB796C` (`file_id`),
  CONSTRAINT `FK_C94A0DED93CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`),
  CONSTRAINT `FK_C94A0DEDA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `file_download`
--


--
-- Table structure for table `file_file`
--

CREATE TABLE `file_file` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `docRef` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `original` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `extension` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mimeType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fileSize` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `hash` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sequence` int NOT NULL,
  `caption` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_5635E7EC335F5CF` (`docRef`),
  KEY `IDX_5635E7EA76ED395` (`user_id`),
  CONSTRAINT `FK_5635E7EA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `file_file`
--


--
-- Table structure for table `file_file_object`
--

CREATE TABLE `file_file_object` (
  `id` int NOT NULL AUTO_INCREMENT,
  `file_id` int NOT NULL,
  `object` longblob NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_3201733193CB796C` (`file_id`),
  CONSTRAINT `FK_3201733193CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `file_file_object`
--


--
-- Table structure for table `location_area`
--

CREATE TABLE `location_area` (
  `id` int NOT NULL AUTO_INCREMENT,
  `facility_id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_579088285E237E06` (`name`),
  KEY `IDX_57908828A7014910` (`facility_id`),
  CONSTRAINT `FK_57908828A7014910` FOREIGN KEY (`facility_id`) REFERENCES `location_facility` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `location_area`
--


--
-- Table structure for table `location_facility`
--

CREATE TABLE `location_facility` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_C10CB6505E237E06` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `location_facility`
--


--
-- Table structure for table `location_facility_logo`
--

CREATE TABLE `location_facility_logo` (
  `id` int NOT NULL AUTO_INCREMENT,
  `facility_id` int NOT NULL,
  `original` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `extension` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mimeType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fileSize` int NOT NULL,
  `logo` longblob NOT NULL,
  `dateCreated` datetime NOT NULL,
  `dateUpdated` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_625A2BEEA7014910` (`facility_id`),
  CONSTRAINT `FK_625A2BEEA7014910` FOREIGN KEY (`facility_id`) REFERENCES `location_facility` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `location_facility_logo`
--


--
-- Table structure for table `location_message`
--

CREATE TABLE `location_message` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type_id` int NOT NULL,
  `user_id` int NOT NULL,
  `update_user_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_58F823DBC54C8C93` (`type_id`),
  KEY `IDX_58F823DBA76ED395` (`user_id`),
  KEY `IDX_58F823DBE0DFCA6C` (`update_user_id`),
  CONSTRAINT `FK_58F823DBA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_58F823DBC54C8C93` FOREIGN KEY (`type_id`) REFERENCES `location_message_type` (`id`),
  CONSTRAINT `FK_58F823DBE0DFCA6C` FOREIGN KEY (`update_user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `location_message`
--


--
-- Table structure for table `location_message_area`
--

CREATE TABLE `location_message_area` (
  `message_id` int NOT NULL,
  `area_id` int NOT NULL,
  PRIMARY KEY (`message_id`,`area_id`),
  KEY `IDX_FA6F6DF537A1329` (`message_id`),
  KEY `IDX_FA6F6DFBD0F409C` (`area_id`),
  CONSTRAINT `FK_FA6F6DF537A1329` FOREIGN KEY (`message_id`) REFERENCES `location_message` (`id`),
  CONSTRAINT `FK_FA6F6DFBD0F409C` FOREIGN KEY (`area_id`) REFERENCES `location_area` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `location_message_area`
--


--
-- Table structure for table `location_message_facility`
--

CREATE TABLE `location_message_facility` (
  `message_id` int NOT NULL,
  `facility_id` int NOT NULL,
  PRIMARY KEY (`message_id`,`facility_id`),
  KEY `IDX_687E95A7537A1329` (`message_id`),
  KEY `IDX_687E95A7A7014910` (`facility_id`),
  CONSTRAINT `FK_687E95A7537A1329` FOREIGN KEY (`message_id`) REFERENCES `location_message` (`id`),
  CONSTRAINT `FK_687E95A7A7014910` FOREIGN KEY (`facility_id`) REFERENCES `location_facility` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `location_message_facility`
--


--
-- Table structure for table `location_message_type`
--

CREATE TABLE `location_message_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `location_message_type`
--


--
-- Table structure for table `mailing_attachment`
--

CREATE TABLE `mailing_attachment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `mailing_id` int NOT NULL,
  `attachment` longblob NOT NULL,
  `filename` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `inline` smallint NOT NULL,
  `contentType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_9F0E80CA3931AB76` (`mailing_id`),
  CONSTRAINT `FK_9F0E80CA3931AB76` FOREIGN KEY (`mailing_id`) REFERENCES `mailing_mailing` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_attachment`
--


--
-- Table structure for table `mailing_deeplink`
--

CREATE TABLE `mailing_deeplink` (
  `id` int NOT NULL AUTO_INCREMENT,
  `target_id` int NOT NULL,
  `mailing_id` int NOT NULL,
  `dateExpiration` date NOT NULL,
  `keyId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_8312868D3931AB76` (`mailing_id`),
  KEY `IDX_8312868D158E0B66` (`target_id`),
  CONSTRAINT `FK_8312868D158E0B66` FOREIGN KEY (`target_id`) REFERENCES `deeplink_target` (`id`),
  CONSTRAINT `FK_8312868D3931AB76` FOREIGN KEY (`mailing_id`) REFERENCES `mailing_mailing` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_deeplink`
--


--
-- Table structure for table `mailing_distribution_list`
--

CREATE TABLE `mailing_distribution_list` (
  `id` int NOT NULL AUTO_INCREMENT,
  `transactional_id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `lastDateSent` datetime DEFAULT NULL,
  `isActive` tinyint(1) NOT NULL,
  `isAutomatic` tinyint(1) NOT NULL,
  `hour` smallint NOT NULL,
  `dayOfWeek` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL COMMENT '(DC2Type:simple_array)',
  `trigger` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL COMMENT '(DC2Type:simple_array)',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_DB8C0E935E237E06` (`name`),
  UNIQUE KEY `UNIQ_DB8C0E936DE44026` (`description`),
  KEY `IDX_DB8C0E9335E6B3C3` (`transactional_id`),
  CONSTRAINT `FK_DB8C0E9335E6B3C3` FOREIGN KEY (`transactional_id`) REFERENCES `mailing_transactional` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_distribution_list`
--


--
-- Table structure for table `mailing_distribution_list_selection`
--

CREATE TABLE `mailing_distribution_list_selection` (
  `distributionlist_id` int NOT NULL,
  `selection_id` int NOT NULL,
  PRIMARY KEY (`distributionlist_id`,`selection_id`),
  KEY `IDX_94378298A03A5D02` (`distributionlist_id`),
  KEY `IDX_94378298E48EFE78` (`selection_id`),
  CONSTRAINT `FK_94378298A03A5D02` FOREIGN KEY (`distributionlist_id`) REFERENCES `mailing_distribution_list` (`id`),
  CONSTRAINT `FK_94378298E48EFE78` FOREIGN KEY (`selection_id`) REFERENCES `admin_selection` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_distribution_list_selection`
--


--
-- Table structure for table `mailing_distribution_list_sent`
--

CREATE TABLE `mailing_distribution_list_sent` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dateSent` datetime NOT NULL,
  `distributionList_id` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_1B7B8E716F87649E` (`distributionList_id`),
  CONSTRAINT `FK_1B7B8E716F87649E` FOREIGN KEY (`distributionList_id`) REFERENCES `mailing_distribution_list` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_distribution_list_sent`
--


--
-- Table structure for table `mailing_distribution_list_user`
--

CREATE TABLE `mailing_distribution_list_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `blocked` smallint NOT NULL,
  `dateSent` datetime DEFAULT NULL,
  `dateEnd` datetime DEFAULT NULL,
  `hash` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `distributionList_id` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_2C2C7291A76ED395` (`user_id`),
  KEY `IDX_2C2C72916F87649E` (`distributionList_id`),
  CONSTRAINT `FK_2C2C72916F87649E` FOREIGN KEY (`distributionList_id`) REFERENCES `mailing_distribution_list` (`id`),
  CONSTRAINT `FK_2C2C7291A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_distribution_list_user`
--


--
-- Table structure for table `mailing_email_message`
--

CREATE TABLE `mailing_email_message` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `template_id` int NOT NULL,
  `mailer_id` int NOT NULL,
  `sender_id` int NOT NULL,
  `identifier` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `emailAddress` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `subject` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `toUser` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL COMMENT '(DC2Type:array)',
  `cc` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci COMMENT '(DC2Type:array)',
  `bcc` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci COMMENT '(DC2Type:array)',
  `message` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `amountOfAttachments` smallint NOT NULL,
  `latestEvent` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `dateLatestEvent` datetime DEFAULT NULL,
  `mailingUser_id` int DEFAULT NULL,
  `distributionListUser_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_295BDD4E772E836A` (`identifier`),
  KEY `IDX_295BDD4EA76ED395` (`user_id`),
  KEY `IDX_295BDD4E400E3E51` (`mailingUser_id`),
  KEY `IDX_295BDD4EF9A17B04` (`distributionListUser_id`),
  KEY `IDX_295BDD4E5DA0FB8` (`template_id`),
  KEY `IDX_295BDD4E3F989867` (`mailer_id`),
  KEY `IDX_295BDD4EF624B39D` (`sender_id`),
  CONSTRAINT `FK_295BDD4E3F989867` FOREIGN KEY (`mailer_id`) REFERENCES `mailing_mailer` (`id`),
  CONSTRAINT `FK_295BDD4E400E3E51` FOREIGN KEY (`mailingUser_id`) REFERENCES `mailing_user` (`id`),
  CONSTRAINT `FK_295BDD4E5DA0FB8` FOREIGN KEY (`template_id`) REFERENCES `mailing_template` (`id`),
  CONSTRAINT `FK_295BDD4EA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_295BDD4EF624B39D` FOREIGN KEY (`sender_id`) REFERENCES `mailing_sender` (`id`),
  CONSTRAINT `FK_295BDD4EF9A17B04` FOREIGN KEY (`distributionListUser_id`) REFERENCES `mailing_distribution_list_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_email_message`
--


--
-- Table structure for table `mailing_email_message_event`
--

CREATE TABLE `mailing_email_message_event` (
  `id` int NOT NULL AUTO_INCREMENT,
  `event` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `time` datetime NOT NULL,
  `messageId` bigint NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `campaign` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `smpt_reply` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `ip` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `agent` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `error` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `errorRelatedTo` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `source` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `emailMessage_id` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_DE31C3035EB02ECF` (`emailMessage_id`),
  CONSTRAINT `FK_DE31C3035EB02ECF` FOREIGN KEY (`emailMessage_id`) REFERENCES `mailing_email_message` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_email_message_event`
--


--
-- Table structure for table `mailing_mailer`
--

CREATE TABLE `mailing_mailer` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `service` smallint NOT NULL,
  `hostname` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `username` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `password` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `port` smallint DEFAULT NULL,
  `ssl` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sendGridApiKey` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `graphTenantId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `graphClientId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `graphClientSecret` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `isDevelopment` tinyint(1) NOT NULL,
  `isActive` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_D176D53E5E237E06` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_mailer`
--

INSERT INTO `mailing_mailer` VALUES (1,'Office 365',1,'smtp.office365.com','info@solodb.net','password',587,'tls',NULL,NULL,NULL,NULL,1,1);

--
-- Table structure for table `mailing_mailing`
--

CREATE TABLE `mailing_mailing` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `template_id` int NOT NULL,
  `sender_id` int NOT NULL,
  `mailer_id` int NOT NULL,
  `mailing` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mailHtml` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mailSubject` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `dateDeleted` datetime DEFAULT NULL,
  `dateLastEmailSent` datetime DEFAULT NULL,
  `dateQueueStart` datetime DEFAULT NULL,
  `tag` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_2F09D431A76ED395` (`user_id`),
  KEY `IDX_2F09D4315DA0FB8` (`template_id`),
  KEY `IDX_2F09D431F624B39D` (`sender_id`),
  KEY `IDX_2F09D4313F989867` (`mailer_id`),
  CONSTRAINT `FK_2F09D4313F989867` FOREIGN KEY (`mailer_id`) REFERENCES `mailing_mailer` (`id`),
  CONSTRAINT `FK_2F09D4315DA0FB8` FOREIGN KEY (`template_id`) REFERENCES `mailing_template` (`id`),
  CONSTRAINT `FK_2F09D431A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_2F09D431F624B39D` FOREIGN KEY (`sender_id`) REFERENCES `mailing_sender` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_mailing`
--


--
-- Table structure for table `mailing_mailing_selection`
--

CREATE TABLE `mailing_mailing_selection` (
  `mailing_id` int NOT NULL,
  `selection_id` int NOT NULL,
  PRIMARY KEY (`mailing_id`,`selection_id`),
  KEY `IDX_335906A73931AB76` (`mailing_id`),
  KEY `IDX_335906A7E48EFE78` (`selection_id`),
  CONSTRAINT `FK_335906A73931AB76` FOREIGN KEY (`mailing_id`) REFERENCES `mailing_mailing` (`id`),
  CONSTRAINT `FK_335906A7E48EFE78` FOREIGN KEY (`selection_id`) REFERENCES `admin_selection` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_mailing_selection`
--


--
-- Table structure for table `mailing_queue`
--

CREATE TABLE `mailing_queue` (
  `id` int NOT NULL AUTO_INCREMENT,
  `mailing_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `dateSend` datetime DEFAULT NULL,
  `mailingUser_id` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_2AA955C7400E3E51` (`mailingUser_id`),
  KEY `IDX_2AA955C73931AB76` (`mailing_id`),
  CONSTRAINT `FK_2AA955C73931AB76` FOREIGN KEY (`mailing_id`) REFERENCES `mailing_mailing` (`id`),
  CONSTRAINT `FK_2AA955C7400E3E51` FOREIGN KEY (`mailingUser_id`) REFERENCES `mailing_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_queue`
--


--
-- Table structure for table `mailing_sender`
--

CREATE TABLE `mailing_sender` (
  `id` int NOT NULL AUTO_INCREMENT,
  `sender` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_sender`
--

INSERT INTO `mailing_sender` VALUES (1,'Mailing owner','info@solodb.net'),(2,'Logged in user','info@solodb.net'),(3,'SoloDB','info@solodb.net');

--
-- Table structure for table `mailing_template`
--

CREATE TABLE `mailing_template` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `subject` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `body` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_template`
--

INSERT INTO `mailing_template` VALUES (1,'default_template','{{ subject }}','<!doctype html>\r\n<html>\r\n<head>\r\n    <meta name=\"viewport\" content=\"width=device-width\"/>\r\n\r\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\r\n    <title>{{ subject }}</title>\r\n    <style>\r\n        img {\r\n            border: none;\r\n            -ms-interpolation-mode: bicubic;\r\n            max-width: 100%;\r\n\r\n        }\r\n\r\n        body {\r\n            background-color: #f6f6f6;\r\n            font-family: sans-serif;\r\n            -webkit-font-smoothing: antialiased;\r\n            font-size: 14px;\r\n            line-height: 1.4;\r\n            margin: 0;\r\n            padding: 0;\r\n            -ms-text-size-adjust: 100%;\r\n            -webkit-text-size-adjust: 100%;\r\n\r\n        }\r\n\r\n        table {\r\n            border-collapse: separate;\r\n            mso-table-lspace: 0pt;\r\n            mso-table-rspace: 0pt;\r\n            width: 100%;\r\n\r\n        }\r\n\r\n        table td {\r\n            font-family: sans-serif;\r\n            font-size: 14px;\r\n            vertical-align: top;\r\n\r\n        }\r\n\r\n        .body {\r\n            background-color: #f6f6f6;\r\n            width: 100%;\r\n\r\n        }\r\n\r\n        /* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */\r\n        .container {\r\n            display: block;\r\n            margin: 0 auto !important;\r\n            /* makes it centered */\r\n            max-width: 580px;\r\n            padding: 10px;\r\n            width: 580px;\r\n\r\n        }\r\n\r\n        /* This should also be a block element, so that it will fill 100% of the .container */\r\n        .content {\r\n            box-sizing: border-box;\r\n            display: block;\r\n            margin: 0 auto;\r\n            max-width: 580px;\r\n            padding: 10px;\r\n\r\n        }\r\n\r\n        /* -------------------------------------            HEADER, FOOTER, MAIN        ------------------------------------- */\r\n        .main {\r\n            background: #ffffff;\r\n            border-radius: 3px;\r\n            width: 100%;\r\n\r\n        }\r\n\r\n        .wrapper {\r\n            box-sizing: border-box;\r\n            padding: 20px;\r\n\r\n        }\r\n\r\n        .content-block {\r\n            padding-bottom: 10px;\r\n            padding-top: 10px;\r\n\r\n        }\r\n\r\n        .footer {\r\n            clear: both;\r\n            margin-top: 10px;\r\n            text-align: center;\r\n            width: 100%;\r\n\r\n        }\r\n\r\n        .footer td, .footer p, .footer span, .footer a {\r\n            color: #999999;\r\n            font-size: 12px;\r\n            text-align: center;\r\n\r\n        }\r\n\r\n        /* -------------------------------------            TYPOGRAPHY        ------------------------------------- */\r\n        h1, h2, h3, h4 {\r\n            color: #000000;\r\n            font-family: sans-serif;\r\n            font-weight: 400;\r\n            line-height: 1.4;\r\n            margin: 0;\r\n            margin-bottom: 30px;\r\n\r\n        }\r\n\r\n        h1 {\r\n            font-size: 35px;\r\n            font-weight: 300;\r\n            text-align: center;\r\n            text-transform: capitalize;\r\n\r\n        }\r\n\r\n        p, ul, ol {\r\n            font-family: sans-serif;\r\n            font-size: 14px;\r\n            font-weight: normal;\r\n            margin: 0;\r\n            margin-bottom: 15px;\r\n\r\n        }\r\n\r\n        p li, ul li, ol li {\r\n            list-style-position: inside;\r\n            margin-left: 5px;\r\n\r\n        }\r\n\r\n        a {\r\n            color: #3498db;\r\n            text-decoration: underline;\r\n\r\n        }\r\n\r\n        /* -------------------------------------            BUTTONS        ------------------------------------- */\r\n        .btn {\r\n            box-sizing: border-box;\r\n            width: 100%;\r\n\r\n        }\r\n\r\n        .btn > tbody > tr > td {\r\n            padding-bottom: 15px;\r\n\r\n        }\r\n\r\n        .btn table {\r\n            width: auto;\r\n\r\n        }\r\n\r\n        .btn table td {\r\n            background-color: #ffffff;\r\n            border-radius: 5px;\r\n            text-align: center;\r\n\r\n        }\r\n\r\n        .btn a {\r\n            background-color: #ffffff;\r\n            border: solid 1px #3498db;\r\n            border-radius: 5px;\r\n            box-sizing: border-box;\r\n            color: #3498db;\r\n            cursor: pointer;\r\n            display: inline-block;\r\n            font-size: 14px;\r\n            font-weight: bold;\r\n            margin: 0;\r\n            padding: 12px 25px;\r\n            text-decoration: none;\r\n            text-transform: capitalize;\r\n\r\n        }\r\n\r\n        .btn-primary table td {\r\n            background-color: #3498db;\r\n\r\n        }\r\n\r\n        .btn-primary a {\r\n            background-color: #3498db;\r\n            border-color: #3498db;\r\n            color: #ffffff;\r\n\r\n        }\r\n\r\n        /* -------------------------------------            OTHER STYLES THAT MIGHT BE USEFUL        ------------------------------------- */\r\n        .last {\r\n            margin-bottom: 0;\r\n\r\n        }\r\n\r\n        .first {\r\n            margin-top: 0;\r\n\r\n        }\r\n\r\n        .align-center {\r\n            text-align: center;\r\n\r\n        }\r\n\r\n        .align-right {\r\n            text-align: right;\r\n\r\n        }\r\n\r\n        .align-left {\r\n            text-align: left;\r\n\r\n        }\r\n\r\n        .clear {\r\n            clear: both;\r\n\r\n        }\r\n\r\n        .mt0 {\r\n            margin-top: 0;\r\n\r\n        }\r\n\r\n        .mb0 {\r\n            margin-bottom: 0;\r\n\r\n        }\r\n\r\n        .preheader {\r\n            color: transparent;\r\n            display: none;\r\n            height: 0;\r\n            max-height: 0;\r\n            max-width: 0;\r\n            opacity: 0;\r\n            overflow: hidden;\r\n            mso-hide: all;\r\n            visibility: hidden;\r\n            width: 0;\r\n\r\n        }\r\n\r\n        .powered-by a {\r\n            text-decoration: none;\r\n\r\n        }\r\n\r\n        hr {\r\n            border: 0;\r\n            border-bottom: 1px solid #f6f6f6;\r\n            margin: 20px 0;\r\n\r\n        }\r\n\r\n        {% verbatim %}\r\n        /* -------------------------------------            RESPONSIVE AND MOBILE FRIENDLY STYLES        ------------------------------------- */\r\n\r\n        @media only screen and (max-width: 620px) {\r\n            table[class=body] h1 {\r\n                font-size: 28px !important;\r\n                margin-bottom: 10px !important;\r\n\r\n            }\r\n\r\n            table[class=body] p, table[class=body] ul, table[class=body] ol, table[class=body] td, table[class=body] span, table[class=body] a {\r\n                font-size: 16px !important;\r\n\r\n            }\r\n\r\n            table[class=body] .wrapper, table[class=body] .article {\r\n                padding: 10px !important;\r\n\r\n            }\r\n\r\n            table[class=body] .content {\r\n                padding: 0 !important;\r\n\r\n            }\r\n\r\n            table[class=body] .container {\r\n                padding: 0 !important;\r\n                width: 100% !important;\r\n\r\n            }\r\n\r\n            table[class=body] .main {\r\n                border-left-width: 0 !important;\r\n                border-radius: 0 !important;\r\n                border-right-width: 0 !important;\r\n\r\n            }\r\n\r\n            table[class=body] .btn table {\r\n                width: 100% !important;\r\n\r\n            }\r\n\r\n            table[class=body] .btn a {\r\n                width: 100% !important;\r\n\r\n            }\r\n\r\n            table[class=body] .img-responsive {\r\n                height: auto !important;\r\n                max-width: 100% !important;\r\n                width: auto !important;\r\n\r\n            }\r\n        }\r\n\r\n        {% endverbatim %}\r\n\r\n        /* -------------------------------------            PRESERVE THESE STYLES IN THE HEAD        ------------------------------------- */\r\n\r\n        @media all {\r\n            .ExternalClass {\r\n                width: 100%;\r\n\r\n            }\r\n\r\n            .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {\r\n                line-height: 100%;\r\n\r\n            }\r\n\r\n            .apple-link a {\r\n                color: inherit !important;\r\n                font-family: inherit !important;\r\n                font-size: inherit !important;\r\n                font-weight: inherit !important;\r\n                line-height: inherit !important;\r\n                text-decoration: none !important;\r\n\r\n            }\r\n\r\n            #MessageViewBody a {\r\n                color: inherit;\r\n                text-decoration: none;\r\n                font-size: inherit;\r\n                font-family: inherit;\r\n                font-weight: inherit;\r\n                line-height: inherit;\r\n\r\n            }\r\n\r\n            .btn-primary table td:hover {\r\n                background-color: #34495e !important;\r\n\r\n            }\r\n\r\n            .btn-primary a:hover {\r\n                background-color: #34495e !important;\r\n                border-color: #34495e !important;\r\n\r\n            }\r\n\r\n\r\n        }\r\n\r\n    </style>\r\n\r\n</head>\r\n\r\n<body class=\"\"><span class=\"preheader\">{{ subject }}</span>\r\n<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\">\r\n    <tr>\r\n        <td>&nbsp;</td>\r\n\r\n        <td class=\"container\">\r\n            <div class=\"content\">                <!-- START CENTERED WHITE CONTAINER -->\r\n                <table role=\"presentation\" class=\"main\">                    <!-- START MAIN CONTENT AREA -->\r\n                    <tr>\r\n                        <td class=\"wrapper\">\r\n                            <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n                                <tr>\r\n                                    <td> {{ content|raw }}</td>\r\n\r\n                                </tr>\r\n\r\n                            </table>\r\n\r\n                        </td>\r\n\r\n                    </tr>\r\n\r\n                    <tr>\r\n                        <td class=\"wrapper\">\r\n                            <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n                                {% if deeplink %}\r\n                                <tr>\r\n                                    <td class=\"center-block\"><small>This email contains a personalised link and should\r\n                                        not be forwarded</small></td>\r\n                                </tr>\r\n                                {% endif %}\r\n                            </table>\r\n                        </td>\r\n                    </tr>\r\n\r\n\r\n                    <!-- END MAIN CONTENT AREA -->\r\n                </table>\r\n                <!-- END CENTERED WHITE CONTAINER -->                <!-- START FOOTER -->\r\n                <div class=\"footer\">\r\n                    <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n                        <tr>\r\n                            <td class=\"content-block\">SoloDB Version {{\r\n                                constant(\"Application\\\\Version\\\\Version::VERSION\") }} - Developed by <a\r\n                                        href=\"https://jield.nl\">Jield\r\n                                    BV</a>\r\n                            </td>\r\n\r\n                        </tr>\r\n\r\n                    </table>\r\n\r\n                </div>\r\n                <!-- END FOOTER -->\r\n            </div>\r\n\r\n        </td>\r\n\r\n        <td>&nbsp;</td>\r\n\r\n    </tr>\r\n\r\n</table>\r\n\r\n</body>\r\n\r\n</html>','2020-04-12 16:45:03','2020-04-12 20:15:24');

--
-- Table structure for table `mailing_transactional`
--

CREATE TABLE `mailing_transactional` (
  `id` int NOT NULL AUTO_INCREMENT,
  `template_id` int NOT NULL,
  `sender_id` int NOT NULL,
  `mailer_id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unique_key` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `mailHtml` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mailSubject` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_B35492725E237E06` (`name`),
  UNIQUE KEY `UNIQ_B3549272E721593` (`unique_key`),
  KEY `IDX_B35492725DA0FB8` (`template_id`),
  KEY `IDX_B3549272F624B39D` (`sender_id`),
  KEY `IDX_B35492723F989867` (`mailer_id`),
  CONSTRAINT `FK_B35492723F989867` FOREIGN KEY (`mailer_id`) REFERENCES `mailing_mailer` (`id`),
  CONSTRAINT `FK_B35492725DA0FB8` FOREIGN KEY (`template_id`) REFERENCES `mailing_template` (`id`),
  CONSTRAINT `FK_B3549272F624B39D` FOREIGN KEY (`sender_id`) REFERENCES `mailing_sender` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_transactional`
--

INSERT INTO `mailing_transactional` VALUES (1,1,3,1,'Run finished','run:update-status:finish','2021-04-25 09:03:29','2022-05-06 12:42:09','<p>Hi {{ fullname }}\r\n<p>{{ user.parseFullName() }} has <strong>finished</strong> run {{ run_label }}\r\n<p>Find here most important run information</p>\r\n<dl>\r\n    <dt>Run label</dt>\r\n    <dd>{{ run_label }}</dd>\r\n    <dt>Run responsible</dt>\r\n    <dd>{{ run.user.parseFullName }}</dd>\r\n    <dt>Location</dt>\r\n    <dd>{{ run.location|default(\"Not provided\") }} </dd>\r\n    <dt>Project</dt>\r\n    <dd>{{ run.project.name }} {% if run.project.isPrivate() %}\r\n            (private){% endif %}\r\n    </dd>\r\n</dl>\r\n{% if message %}\r\n<p>When {{ user.parseFullName() }} finished the run, the following message was given:\r\n<p>{{ message }}\r\n    {% endif %}\r\n<p>The run status is now <strong>{{ status_text }}</strong>\r\n<p>Use the following link to go directly to the run details page:\r\n<p>{{ deeplink }}\r\n','Run {{ run_label }} finished'),(2,1,3,1,'Run reopened','run:update-status:reopen','2021-04-25 09:03:30','2022-05-06 12:45:21','<p>Hi {{ fullname }}\r\n<p>{{ user.parseFullName() }} has <strong>reopened</strong> run {{ run_label }}\r\n<p>Find here most important run information</p>\r\n<dl>\r\n    <dt>Run label</dt>\r\n    <dd>{{ run_label }}</dd>\r\n    <dt>Run responsible</dt>\r\n    <dd>{{ run.user.parseFullName }}</dd>\r\n    <dt>Location</dt>\r\n    <dd>{{ run.location|default(\"Not provided\") }} </dd>\r\n    <dt>Project</dt>\r\n    <dd>{{ run.project.name }} {% if run.project.isPrivate() %}\r\n            (private){% endif %}\r\n    </dd>\r\n</dl>\r\n{% if message %}\r\n<p>When {{ user.parseFullName() }} reopened the run, the following message was given:\r\n<p>{{ message }}\r\n    {% endif %}\r\n<p>The run status is now <strong>{{ status_text }}</strong>\r\n<p>Use the following link to go directly to the run details page:\r\n<p>{{ deeplink }}\r\n','Run {{ run_label }} reopened'),(3,1,3,1,'Run cancelled','run:update-status:cancel','2021-04-25 09:03:30','2022-05-06 12:42:54','<p>Hi {{ fullname }}\r\n<p>{{ user.parseFullName() }} has <strong>cancelled</strong> run {{ run_label }}\r\n<p>Find here most important run information</p>\r\n<dl>\r\n    <dt>Run label</dt>\r\n    <dd>{{ run_label }}</dd>\r\n    <dt>Run responsible</dt>\r\n    <dd>{{ run.user.parseFullName }}</dd>\r\n    <dt>Location</dt>\r\n    <dd>{{ run.location|default(\"Not provided\") }} </dd>\r\n    <dt>Project</dt>\r\n    <dd>{{ run.project.name }} {% if run.project.isPrivate() %}\r\n            (private){% endif %}\r\n    </dd>\r\n</dl>\r\n{% if message %}\r\n<p>When {{ user.parseFullName() }} cancelled the run, the following message was given:\r\n<p>{{ message }}\r\n    {% endif %}\r\n<p>The run status is now <strong>{{ status_text }}</strong>\r\n<p>Use the following link to go directly to the run details page:\r\n<p>{{ deeplink }}\r\n','Run {{ run_label }} cancelled'),(4,1,3,1,'Request to start run (to involved users)','run:update-status:waiting-for-approval','2021-04-25 09:03:30','2022-05-06 12:49:16','Request to start run {{ run_label }} approved by {{ user.parseFullName() }}\r\n<p>Hi {{ fullname }}\r\n<p>{{ user.parseFullName() }} has <strong>requested</strong> to start run {{ run_label }}\r\n<p>Find here most important run information</p>\r\n<dl>\r\n    <dt>Run label</dt>\r\n    <dd>{{ run_label }}</dd>\r\n    <dt>Run responsible</dt>\r\n    <dd>{{ run.user.parseFullName }}</dd>\r\n    <dt>Location</dt>\r\n    <dd>{{ run.location|default(\"Not provided\") }} </dd>\r\n    <dt>Project</dt>\r\n    <dd>{{ run.project.name }} {% if run.project.isPrivate() %}\r\n            (private){% endif %}\r\n    </dd>\r\n</dl>\r\n<p>The run requires approval to start for the following reason\r\n<ul>\r\n    {% for reason in approval_required_reasons %}\r\n        <li>{{ reason }}</li>\r\n    {% endfor %}\r\n</ul>\r\n<p>The following users have permission to approve the run</p>\r\n<ul>\r\n    {% for approval_user in users_for_approval %}\r\n        <li>{{ approval_user.user.parseFullName() }}</li>\r\n    {% endfor %}\r\n</ul>\r\n{% if message %}\r\n    <p>When {{ user.parseFullName() }} created the request, the following message was given:\r\n<p>{{ message }}\r\n    {% endif %}\r\n<p>The run status is now <strong>{{ status_text }}</strong> and an email has been sent to the responsbile users who can start the run\r\n<p>Use the following link to go directly to the run:\r\n<p>{{ deeplink }}','Run {{ run_label }} is waiting for approval'),(5,1,3,1,'Run started','run:update-status:start','2021-04-25 09:03:30','2022-05-06 12:45:54','<p>Hi {{ fullname }}\r\n<p>{{ user.parseFullName() }} has <strong>started</strong> run {{ run_label }}\r\n<p>Find here most important run information</p>\r\n<dl>\r\n    <dt>Run label</dt>\r\n    <dd>{{ run_label }}</dd>\r\n    <dt>Run responsible</dt>\r\n    <dd>{{ run.user.parseFullName }}</dd>\r\n    <dt>Location</dt>\r\n    <dd>{{ run.location|default(\"Not provided\") }} </dd>\r\n    <dt>Project</dt>\r\n    <dd>{{ run.project.name }} {% if run.project.isPrivate() %}\r\n            (private){% endif %}\r\n    </dd>\r\n</dl>\r\n{% if message %}\r\n<p>When {{ user.parseFullName() }} started the run, the following message was given:\r\n<p>{{ message }}\r\n    {% endif %}\r\n<p>The run status is now <strong>{{ status_text }}</strong>\r\n<p>Use the following link to go directly to the run details page:\r\n<p>{{ deeplink }}\r\n','Run {{ run_label }} started'),(6,1,3,1,'Run start request approved','run:update-status:approve','2021-04-25 09:03:30','2022-05-06 12:40:37','<p>Hi {{ fullname }}\r\n<p>{{ user.parseFullName() }} has <strong>approved</strong> the request to start run {{ run_label }}\r\n<p>Find here most important run information</p>\r\n<dl>\r\n    <dt>Run label</dt>\r\n    <dd>{{ run_label }}</dd>\r\n    <dt>Run responsible</dt>\r\n    <dd>{{ run.user.parseFullName }}</dd>\r\n    <dt>Location</dt>\r\n    <dd>{{ run.location|default(\"Not provided\") }} </dd>\r\n    <dt>Project</dt>\r\n    <dd>{{ run.project.name }} {% if run.project.isPrivate() %}\r\n            (private){% endif %}\r\n    </dd>\r\n</dl>\r\n{% if comment %}\r\n    <p>When {{ user.parseFullName() }} approved the request, the following comment was given:\r\n<p>{{ comment }}\r\n    {% endif %}\r\n<p>The run status is now <strong>{{ status_text }}</strong>\r\n<p>Use the following link to go directly to the run details page:\r\n<p>{{ deeplink }}','Request to start run {{ run_label }} approved by {{ user.parseFullName() }}'),(7,1,3,1,'Run start request declined','run:update-status:decline','2021-04-25 09:03:30','2022-05-06 12:44:17','<p>Hi {{ fullname }}\r\n<p>{{ user.parseFullName() }} has <strong>declined</strong> the request to start run {{ run_label }}\r\n<p>Find here most important run information</p>\r\n<dl>\r\n    <dt>Run label</dt>\r\n    <dd>{{ run_label }}</dd>\r\n    <dt>Run responsible</dt>\r\n    <dd>{{ run.user.parseFullName }}</dd>\r\n    <dt>Location</dt>\r\n    <dd>{{ run.location|default(\"Not provided\") }} </dd>\r\n    <dt>Project</dt>\r\n    <dd>{{ run.project.name }} {% if run.project.isPrivate() %}\r\n            (private){% endif %}\r\n    </dd>\r\n</dl>\r\n{% if comment %}\r\n    <p>When {{ user.parseFullName() }} declined the request, the following comment was given:\r\n<p>{{ comment }}\r\n    {% endif %}\r\n<p>The run status is now <strong>{{ status_text }}</strong>\r\n<p>Use the following link to go directly to the run details page:\r\n<p>{{ deeplink }}','Request to start run {{ run_label }} declined by {{ user.parseFullName() }}'),(9,1,3,1,'Reset password','user:forgotpassword','2021-04-25 09:03:30','2022-05-06 13:57:47','Dear {{ fullname }},\r\n<p>Please use the following url to reset your password.\r\n<p>{{ deeplink }}','Forgotten password'),(10,1,3,1,'Cancelled equipment reservation','equipment:cancel-reservation','2021-04-25 09:03:31','2022-05-06 13:38:25','<p>Hi {{ fullname }},\r\n<p>{{ requester.parseFullName() }}has canceled the reservation on {{ equipment.parseName() }} in\r\n    from {{ start_date|date(\'l, j F Y H:i\') }} to {{ end_date|date(\'l, j F Y H:i\') }}\r\n<p>First user who makes a new reservation in my cancelled slot can use the tool.','Reservation on {{ equipment.number }} {{ equipment }} cancelled'),(11,1,3,1,'Mail to users of an equipment','equipment:mail-users','2021-04-25 09:03:31','2022-05-06 13:46:03','{{ body|nl2br }}','[{{ equipment.parseName() }}] {{ subject }}'),(12,1,3,1,'New equipment reservation','equipment:new-reservation','2021-04-25 09:03:31','2022-05-06 13:23:21','<p>Hi {{ fullname }}\r\n<p>You have made a reservation for {{ equipment.parseName() }} in {{ equipment.room.name }}</p>\r\n<p>The reservation starts on {{ start_date|date(\'l, j F Y H:i\') }} and ends on {{ end_date|date(\'l, j F Y H:i\') }}</p>\r\n{% if is_recurring %}\r\n    <p>The reservation is recurring and will be repeated every {{ recurring_text }}</p>\r\n{% endif %}\r\n{% if is_reservation_approval_required %}\r\n    <p>For this reservation is approval required, an email has been sent to the equipment responsnbiles for approval.\r\n        You will recieve an email when there is an update</p>\r\n{% endif %}','{% if is_reservation_approval_required %}Tentative {% endif %} Reservation for {{ equipment.parseName() }} in {{ equipment.room.name }}'),(16,1,3,1,'New equipment training request','equipment:new-request','2021-04-25 09:03:31','2022-05-06 13:30:57','<p>Hi {{ fullname }}\r\n<p>{{ requester.parseFullName() }} started a request for training for {{ equipment.parseName() }}, with the following details\r\n<dl>\r\n    <dt>Reason</dt>\r\n    <dd>{{ request.reason|nl2br }}</dd>\r\n    <dt>Material</dt>\r\n    <dd>{{ request.materials|nl2br }}</dd>\r\n    <dt>Frequency</dt>\r\n    <dd>{{ request.frequency|nl2br }}</dd>\r\n</dl>\r\n<p>The current status is <strong>{{ flow_status_text }}</strong>\r\n<p>A detailed overview of the approval flow is given below\r\n<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\">\r\n    <thead>\r\n    <tr>\r\n        <th>Order</th>\r\n        <th>User</th>\r\n        <th>Status</th>\r\n    </tr>\r\n    </thead>\r\n    <tbody>\r\n    {% for flow in request.flow %}\r\n        <tr>\r\n            <td>{{ loop.index }}</td>\r\n            <td>{{ flow.user }}</td>\r\n            <td>{{ flow.parseStatusText() }}</td>\r\n        </tr>\r\n    {% endfor %}\r\n    </tbody>\r\n</table>\r\n<br><br>\r\n<p>Use the link below to go to the request page</p>\r\n<p>{{ deeplink }}</p>','New training request for {{ equipment.parseName() }}'),(17,1,3,1,'Approval flow for training on equipment complete','equipment:update-approval:complete','2021-04-25 09:03:31','2022-05-06 12:30:21','<p>Hi {{ fullname }} </p>\r\n<p>Your equipment training request has been <strong>completed</strong> by {{ approver.parseFullName() }}. You are now trained on\r\n    equipment: {{ equipment.parseName() }} in {{ equipment.room.name }}<br>\r\n<p>a detailed overview of the approval flow is given below<br>\r\n<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\">\r\n    <thead>\r\n    <tr>\r\n        <th>Order</th>\r\n        <th>User</th>\r\n        <th>Status</th>\r\n    </tr>\r\n    </thead>\r\n    <tbody>\r\n    {% for flow in request.flow %}\r\n        <tr>\r\n            <td>{{ loop.index }}</td>\r\n            <td>{{ flow.user.parseFullName() }}</td>\r\n            <td>{{ flow.parseStatusText() }}</td>\r\n        </tr>\r\n    {% endfor %}\r\n    </tbody>\r\n</table>\r\n<br><br>\r\n<p>Use the link below to visit the equipment</p>\r\n<p>{{ deeplink }}</p>','Completed training request for {{ equipment.parseName() }} in {{ equipment.room.name }}'),(18,1,3,1,'Update of approval flow for equipment training','equipment:update-approval:incomplete','2021-04-25 09:03:32','2022-05-06 12:26:36','<p>Hi {{ fullname }} </p>\r\n<p>The status of your training request on {{ equipment.parseName() }} in {{ equipment.room.name }} has been updated\r\n    by {{ approver.parseFullName() }}\r\n<p>a detailed overview of the approval flow is given below<br>\r\n<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\">\r\n    <thead>\r\n    <tr>\r\n        <th>Order</th>\r\n        <th>User</th>\r\n        <th>Status</th>\r\n    </tr>\r\n    </thead>\r\n    <tbody>\r\n    {% for flow in request.flow %}\r\n        <tr>\r\n            <td>{{ loop.index }}</td>\r\n            <td>{{ flow.user.parseFullName() }}</td>\r\n            <td>{{ flow.parseStatusText() }}</td>\r\n        </tr>\r\n    {% endfor %}\r\n    </tbody>\r\n</table>\r\n<br><br>\r\n<p>The approval has not been finalised yet, other responsibles also need to give their approval.</p>\r\n<p>{{ deeplink }}</p>','Updated training request for {{ equipment.parseName() }} in {{ equipment.room.name }}'),(19,1,3,1,'Equipment status update','equipment:update-status','2021-04-25 09:03:32','2022-05-06 13:17:43','<p>Hi {{ fullname }}\r\n<p>The status of {{ equipment_module_name }} has been updated to <strong>{{ status_text }}</strong>.\r\n<p>The update was done by {{ updater.parseFullName() }} and the previous status was {{ previous_status_text }}</p>\r\n{% if status_description %}\r\n    <p>The message given was:</p>\r\n    <p>{{ status_description|nl2br }}</p>\r\n{% endif %}\r\n{% if has_room %}\r\n    <p>The equipment is located in {{ room.name }}, {{ building.name }}</p>\r\n{% endif %}\r\n<p>Use the link below to check the equipment</p>\r\n<p>{{ deeplink }}','Status of {{ equipment_module_name }} updated to {{ status_text }}'),(21,1,3,1,'Equipment reservation approved','equipment:new-reservation-approved','2021-04-25 09:03:32','2022-05-06 13:42:13','<p>Hi {{ fullname }},\r\n<p>You made a tentative reservation for {{ equipment.parseName() }} in {{ room.name }}\r\n<p>The reservation starts on {{ start_date|date(\'l, j F Y H:i\') }} and ends on {{ end_date|date(\'l, j F Y H:i\') }}\r\n<p>The reservation has been <strong>approved</strong>\r\n    {% if feedback %}\r\n    <p>Upon approval, the following message was given<p>\r\n    <p>{{ feedback }}</p>\r\n{% endif %}','Reservation for {{ equipment.parseName() }} approved'),(22,1,3,1,'Equipment reservation declined','equipment:new-reservation-declined','2021-04-25 09:03:32','2022-05-06 13:42:59','<p>Hi {{ fullname }},\r\n<p>You made a tentative reservation for {{ equipment.parseName() }} in {{ room.name }}\r\n<p>The reservation starts on {{ start_date|date(\'l, j F Y H:i\') }} and ends on {{ end_date|date(\'l, j F Y H:i\') }}\r\n<p>The reservation has been <strong>declined</strong>\r\n    {% if feedback %}\r\n    <p>Upon approval, the following message was given<p>\r\n    <p>{{ feedback }}</p>\r\n{% endif %}','Reservation for {{ equipment.parseName() }} declined'),(24,1,3,1,'Statusmail','equipment:statusmail','2021-04-25 09:03:32','2022-05-06 13:09:49','<h1>{{ statusmail }} Statusmail</h1>\r\n<p>Hello,\r\n<p>This is the {{ statusmail }} statusmail of {{ \"now\"|date(\'l, d F Y H:i:s\') }}\r\n<br><br>\r\n{{ statusmail_content|raw }}','{{ statusmail }}'),(29,1,3,1,'Declined training request of equipment','equipment:update-approval:denied','2021-04-25 09:03:33','2022-05-06 12:28:52','<p>Hi {{ fullname }} </p>\r\n<p>The status of your training request on {{ equipment.parseName() }} in {{ equipment.room.name }} has been <strong>declined</strong>\r\n    by {{ approver.parseFullName() }}\r\n<p>a detailed overview of the approval flow is given below<br>\r\n<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\">\r\n    <thead>\r\n   <tr>\r\n        <th>Order</th>\r\n        <th>User</th>\r\n        <th>Status</th>\r\n    </tr>\r\n    </thead>\r\n    <tbody>\r\n    {% for flow in request.flow %}\r\n        <tr>\r\n            <td>{{ loop.index }}</td>\r\n            <td>{{ flow.user.parseFullName() }}</td>\r\n            <td>{{ flow.parseStatusText() }}</td>\r\n        </tr>\r\n    {% endfor %}\r\n    </tbody>\r\n</table>\r\n<br><br>\r\n<p>As at least on of the responsibles declined the request, your training request will not be granted</p>\r\n<p>{{ deeplink }}</p>','Declined training request for {{ equipment.parseName() }} in {{ equipment.room.name }}'),(31,1,3,1,'Request to start run (to users for approval)','run:update-status:request-for-approval','2021-04-25 09:03:33','2022-05-06 12:47:53','<p>Hi {{ fullname }}\r\n<p>{{ user.parseFullName() }} has <strong>requested</strong> to start run {{ run_label }}\r\n<p>Find here most important run information</p>\r\n<dl>\r\n    <dt>Run label</dt>\r\n    <dd>{{ run_label }}</dd>\r\n    <dt>Run responsible</dt>\r\n    <dd>{{ run.user.parseFullName }}</dd>\r\n    <dt>Location</dt>\r\n    <dd>{{ run.location|default(\"Not provided\") }} </dd>\r\n    <dt>Project</dt>\r\n    <dd>{{ run.project.name }} {% if run.project.isPrivate() %}\r\n            (private){% endif %}\r\n    </dd>\r\n</dl>\r\n<p>The run requires approval to start for the following reason\r\n<ul>\r\n    {% for reason in approval_required_reasons %}\r\n        <li>{{ reason }}</li>\r\n    {% endfor %}\r\n</ul>\r\n<p>The following users have permission to approve the run</p>\r\n<ul>\r\n    {% for approval_user in users_for_approval %}\r\n        <li>{{ approval_user.user.parseFullName() }}</li>\r\n    {% endfor %}\r\n</ul>\r\n{% if message %}\r\n    <p>When {{ user.parseFullName() }} created the request, the following message was given:\r\n<p>{{ message }}\r\n    {% endif %}\r\n<p>The run status is now <strong>{{ status_text }}</strong>\r\n<p>Use the following link to go directly to the run approval page:\r\n<p>{{ deeplink }}','Request for approval of run {{ run_label }}'),(32,1,3,1,'Update on service work','run:servicework:update','2021-04-25 09:03:33',NULL,'{{amount_of_steps}}\r\n{{run_label}}\r\n{{run}}\r\n{{dispatched_text}}\r\n{{status_text}}\r\n-------------------\r\n<p>Hello {{ fullname }},\r\n<p>There is a update for the service work of {{ amount_of_steps }} steps in run {{ run_label }} with name {{ run_name }}\r\n<p>Use this <a href=\"{{ deeplink }}\">direct link</a> to check the service work in SoloDB.\r\n<p>The service work is now <strong>{{ dispatched }}</strong> and the new status is <strong>{{ status }}</strong>','Update for service work in {{ run_label }}: {{ run_name }}'),(33,1,3,1,'New service work request','run:servicework:request','2021-04-25 09:03:34',NULL,'{{amount_of_steps}}\r\n{{run_label}}\r\n{{run}}\r\n-------------------\r\n<p>Hello {{ fullname }},\r\n<p>There is a request for service work of {{ amount_of_steps }} steps in run {{ run_label }} with name {{ run_name }}\r\n<p>Use this <a href=\"{{ deeplink }}\">direct link</a> to check the service work in SoloDB.','Request for service work in {{ run_label }}: {{ run_name }}'),(34,1,3,1,'Mailing queue finished','mailing:queue:finish','2021-04-25 09:03:34','2022-05-06 13:39:18','<p>Hi {{ fullname }}\r\n<p>Here I am again.\r\n<p>I am done. Mailing {{ mailing }} with {{ subject }} has been sent to {{ amount_of_users }} users. \r\n<p>It took me {{ total_time }} seconds, so now it is time for me to sit back and relax :)','Sending of {{ mailing }} has completed: {{ amount_of_users }} mails sent'),(35,1,3,1,'Mailing queue started','mailing:queue:start','2021-04-25 09:03:34','2022-05-06 13:38:55','<p>Hi {{ fullname }}\r\n<p>At {{ start_time }} the magnificant Bot has started to send the mailing {{ mailing }} with subject {{ subject }} to {{ amout_of_users }} users.\r\n<p>You will receive a second email when the sending has completed.\r\n<p>Meanwhile sit back and relax :) ','Sending of {{ mailing }} has started'),(36,1,3,1,'Update access request to room (incomplete)','room:update-approval:incomplete','2020-04-12 17:36:28','2022-05-06 13:00:04','<p>Hi {{ fullname }} </p>\r\n<p>The status of your training request on ({{ room.name }}) has been <strong>updated</strong>\r\n    by {{ approver.parseFullName() }}.\r\n    {% if has_mentor %}\r\n<p>{{ mentor.parseFullName() }} is mentor for your training, please contact your mentor for further details</p>\r\n{% endif %}\r\n<p>a detailed overview of the approval flow is given below<br>\r\n<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\">\r\n    <thead>\r\n    <tr>\r\n        <th>Order</th>\r\n        <th>User</th>\r\n        <th>Status</th>\r\n    </tr>\r\n    </thead>\r\n    <tbody>\r\n    {% for flow in request.flow %}\r\n        <tr>\r\n            <td>{{ loop.index }}</td>\r\n            <td>{{ flow.user.parseFullName() }}</td>\r\n            <td>{{ flow.parseStatusText() }}</td>\r\n        </tr>\r\n    {% endfor %}\r\n    </tbody>\r\n</table>\r\n<br><br>\r\n<p>Use the link below to go to the room</p>\r\n<p>{{ deeplink }}</p>','Updated access request for {{ room.name }}'),(37,1,3,1,'Completed room access request','room:update-approval:complete','2020-04-12 17:36:28','2022-05-06 12:58:19','<p>Hi {{ fullname }} </p>\r\n<p>The status of your training request on ({{ room.name }}) has been <strong>completed</strong>\r\n    by {{ approver.parseFullName() }}. Please check if any other actions are required for access to this room.\r\n    {% if has_mentor %}\r\n<p>{{ mentor.parseFullName() }} is mentor for your training, please contact your mentor for further details</p>\r\n{% endif %}\r\n<p>Note that Equipage is only Lab management and has no influence on your badge programming.\r\n<p>a detailed overview of the approval flow is given below<br>\r\n<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\">\r\n    <thead>\r\n    <tr>\r\n        <th>Order</th>\r\n        <th>User</th>\r\n        <th>Status</th>\r\n    </tr>\r\n    </thead>\r\n    <tbody>\r\n    {% for flow in request.flow %}\r\n        <tr>\r\n            <td>{{ loop.index }}</td>\r\n            <td>{{ flow.user.parseFullName() }}</td>\r\n            <td>{{ flow.parseStatusText() }}</td>\r\n        </tr>\r\n    {% endfor %}\r\n    </tbody>\r\n</table>\r\n<br><br>\r\n{% if has_training_description %}\r\n    <strong>Training description</strong><br>\r\n    <p>{{ training_description }}</p>\r\n{% endif %}\r\n<p>Use the link below to go to the room</p>\r\n<p>{{ deeplink }}</p>','Completed access request for {{ room.name }}'),(38,1,3,1,'Mail to users of room','room:mail-users','2020-04-12 17:36:32','2022-05-06 13:45:27','{{ body|nl2br }}','[{{ room }}] {{ subject }}'),(39,1,3,1,'Added new responsible to room (to user)','room:add-role:user','2020-04-12 17:36:32','2022-05-06 12:16:47','<p>Hi {{ fullname }} </p>\r\n<p>You were added as {{ role.title }} or your role has been updated to {{ role.title }} in {{ room.name }}\r\n    ({{ room.code }}) by {{ assignee.parseFullName() }}</p>\r\n{% if is_in_approval_flow %}\r\n    <p>You are in the approval flow so you have to accept new training requests</p>\r\n{% else %}\r\n    <p>You are <strong>not</strong> in the approval flow so you have to accept new training requests</p>\r\n{% endif %}\r\n<p>Use the link below to view all details</p>\r\n<p>{{ deeplink }}</p>','Your role in {{ room.name }} ({{ room.code}}) has been updated'),(40,1,3,1,'Added new responsible to room (to other responsibles)','room:add-role:role','2020-04-12 17:36:33','2022-05-06 12:18:53','<p>Hi {{ fullname }} </p>\r\n<p>{{ assignee.parseFullName() }} has added or updated {{ user.parseFullName() }} as {{ role.title }} in {{ room.name }}\r\n    ({{ room.code }})</p>\r\n{% if is_in_approval_flow %}\r\n    <p>{{ user.parseFullName() }} is in the approval flow so has to accept new training requests</p>\r\n{% else %}\r\n    <p>{{ user.parseFullName() }} is <strong>not</strong> in the approval flow so does not need to accept new training\r\n        requests</p>\r\n{% endif %}\r\n<p>Use the link below to view the responsible</p>\r\n<p>{{ deeplink }}</p>','Responsible user {{ user.parseFullName() }} in {{ room.name }} ({{ room.code}}) has been added or updated'),(41,1,3,1,'Access request for room','room:new-request','2020-04-12 17:36:34','2022-05-06 13:36:10','<p>Hi {{ fullname }}\r\n<p>{{ requester.parseFullName() }} requested access for {{ room.name }}, with the following details\r\n<dl>\r\n    <dt>Reason</dt>\r\n    <dd>{{ request.reason|nl2br }}</dd>\r\n    <dt>Material</dt>\r\n    <dd>{{ request.materials|nl2br }}</dd>\r\n    <dt>Frequency</dt>\r\n    <dd>{{ request.frequency|nl2br }}</dd>\r\n    <dt>Equipment</dt>\r\n    <dd>{{ request.equipment|nl2br }}</dd>\r\n</dl>\r\n{% if has_mentor %}\r\n    <p>{{ mentor.parseFullName() }} as requested to be a mentor for the training</p>\r\n{% endif %}\r\n<p>The current status is <strong>{{ status_text }}</strong>\r\n<p>A detailed overview of the approval flow is given below\r\n<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\">\r\n    <thead>\r\n    <tr>\r\n        <th>Order</th>\r\n        <th>User</th>\r\n        <th>Status</th>\r\n    </tr>\r\n    </thead>\r\n    <tbody>\r\n    {% for flow in request.flow %}\r\n        <tr>\r\n            <td>{{ loop.index }}</td>\r\n            <td>{{ flow.user.parseFullName() }}</td>\r\n            <td>{{ flow.parseStatusText() }}</td>\r\n        </tr>\r\n    {% endfor %}\r\n    </tbody>\r\n</table>\r\n<br><br>\r\n<p>Use the link below to go to the request page</p>\r\n<p>{{ deeplink }}</p>','New access request for {{ room.name }} by {{ requester.parseFullName() }}'),(44,1,3,1,'New request for room access (for mentor)','room:new-request:mentor','2020-04-12 17:36:35','2022-05-06 13:44:51','<p>Hi {{ fullname }}\r\n<p>{{ requester.parseFullName() }} asked access to {{ room.name }} and indicated you as his mentor.\r\n<p>Use the link below to visit the request page and approve or decline this request\r\n<p>{{ deeplink }}','You are mentor for a new training request in {{ room.name }}'),(45,1,3,1,'Denied room access request','room:update-approval:denied','2020-04-12 17:36:35','2022-05-06 12:57:40','<p>Hi {{ fullname }} </p>\r\n<p>The status of your training request on ({{ room.name }}) has been <strong>declined</strong>\r\n    by {{ approver.parseFullName() }}. Your training request has been archived.\r\n    {% if has_mentor %}\r\n<p>{{ mentor.parseFullName() }} is mentor for your training, please contact your mentor for further details</p>\r\n{% endif %}\r\n<p>a detailed overview of the approval flow is given below<br>\r\n<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\">\r\n    <thead>\r\n    <tr>\r\n        <th>Order</th>\r\n        <th>User</th>\r\n        <th>Status</th>\r\n    </tr>\r\n    </thead>\r\n    <tbody>\r\n    {% for flow in request.flow %}\r\n        <tr>\r\n            <td>{{ loop.index }}</td>\r\n            <td>{{ flow.user.parseFullName() }}</td>\r\n            <td>{{ flow.parseStatusText() }}</td>\r\n        </tr>\r\n    {% endfor %}\r\n    </tbody>\r\n</table>\r\n<br><br>\r\n<p>Use the link below to go to the room</p>\r\n<p>{{ deeplink }}</p>','Your access request for {{ room.name }} has been declined'),(46,1,3,1,'Confirmation of mentor for room training','room:request:mentor-confirmation','2020-04-12 17:36:35','2022-05-06 13:03:07','<p>Hi {{ fullname }},\r\n<p>Thank you for accepting the extra task as {{ room.name }} mentor for {{ requester.parseFullName() }}\r\n<p>The system is brought to life for safety reasons and to avoid new people being thrown in at the deep and expected to\r\n    swim. Here’s a brief summary of what’s expected from you as {{ room.name }} mentor:\r\n<ul>\r\n    <li>Help the new users to complete Lab access procedure 3 steps:\r\n        <ol>\r\n            <li>Rules of conduct via Academy</li>\r\n            <li>Badge programming via Employee center</li>\r\n        </ol>\r\n    </li>\r\n    <li>Introduce/guide new users in the {{ room.name }} while they wait for their own access</li>\r\n    <li>Getting the new user acquainted with the lab -> Where to find materials, which tools he/she would need for\r\n        his/her personal work or experiments etc...\r\n    </li>\r\n    <li>You are their primary contact in case they have any questions</li>\r\n    <li>Assist them to get started with their lab work properly</li>\r\n    <li>Be sure to take responsibility that the new user can safely prepare and dispose their required chemical\r\n        solutions, and properly clean up after use (Chemicals/Wet Bench certificate required for {{ room.name }} access\r\n        – time\r\n        required due to lower frequency of these trainings)\r\n    </li>\r\n    <li>Point out unsafe situations/actions if needed -> wrong use of chemicals/protection, Closing Wet Bench while\r\n        working as much as possible, wrong use of tools etc...\r\n    </li>\r\n    <li>Evaluate the new user and judge responsibly when the new user can be considered fully capable of working\r\n        completely independent, and decide when the user can be considered an \"Active User\"\r\n    </li>\r\n    <li><u>Anything you as mentor can add to this summary yourself, any feedback from you would be a great help to\r\n            us.</u>\r\n    </li>\r\n</ul>\r\n<p>The purpose of this system is to bring the service, quality and safety in our lab to higher standards. We are very\r\n    glad you are part of it and make it possible</p>\r\n<p>Thank you !\r\n<p>The {{ room.name }} team','Thank you for being a mentor for {{ requester.parseFullName() }} in {{ room.name }}'),(48,1,3,1,'Declined mentor request','room:delete-request:mentor','2020-04-12 17:36:36','2022-05-06 13:09:19','<p>Hello {{ fullname }}\r\n    {% if deleter.id != mentor.id %}\r\n    <p>{{ deleter.parseFullName() }} has <strong>declined</strong> your request to have {{ mentor.parseFullName() }} as mentor for your\r\n        training in {{ room.name }}</p>\r\n{% else %}\r\n    <p>{{ mentor.parseFullName() }} has <strong>declined</strong> your request to be mentor for your\r\n        training in {{ room.name }}</p>\r\n    {% endif %}\r\n<p>When {{ deleter.parseFullName }} declined your request, the follow message was given\r\n<p>{{ message }}\r\n<p>Your request has been removed and you should do a new request with another mentor.','Mentor request declined for training in {{ room.name }}'),(50,1,3,1,'Document uploaded in room','room:upload-document','2020-04-26 17:37:37','2022-05-06 13:51:15','<p>Hi {{ fullname }},\r\n<p>{{ uploader.parseFullName }} has uploaded a new document in {{ room.name }}\r\n<p>The filename of the document is {{ filename }}\r\n    {% if description %}\r\n    <p>The description written by {{ uploader.parseFullName }} when the file was uploaded was:\r\n<p>{{ description }}\r\n    {% endif %}\r\n<p>The document has been saved on the server and has also been attached to this email\r\n<p>You can view all documents of the room via the link below\r\n<p>{{ deeplink }}','Document {{ filename }} uploaded in {{ room.name }}'),(51,1,3,1,'Document uploaded to equipment','equipment:upload-document','2020-04-26 17:40:42','2022-05-06 13:52:23','<p>Hi {{ fullname }},\r\n<p>{{ uploader.parseFullName }} has uploaded a new document in {{ equipment.parseName() }}\r\n<p>The filename of the document is {{ filename }}\r\n    {% if description %}\r\n<p>The description written by {{ uploader.parseFullName }} when the file was uploaded was:\r\n<p>{{ description }}\r\n    {% endif %}\r\n<p>The document has been saved on the server and has also been attached to this email\r\n<p>You can view all documents of the equipment via the link below\r\n<p>{{ deeplink }}','Document {{ filename }} uploaded to {{ equipment.parseName() }}'),(52,1,3,1,'Mail to user when someone creates a new reservation in  a zone','zone:new-reservation','2020-04-26 17:42:53','2022-05-06 13:55:09','<p>Hi {{ fullname }}\r\n<p>You have made a reservation for zone {{ zone }} in {{ zone_group }} of {{ room.name }}\r\n<p>The reservation starts on {{ start_date|date(\'l, j F Y H:i\') }} and ends on {{ end_date|date(\'l, j F Y H:i\') }}.\r\n    {% if is_recurring %}\r\n<p>The reservation is recurring and will be repeated every {{ recurring_text }}\r\n    {% endif %}','Reservation for zone {{ zone }} in {{ zone_group }} of {{ room.name }}'),(53,1,3,1,'Mail to user who made a reservation for a zone but has been cancelled','zone:cancel-reservation','2020-04-26 17:45:56','2022-05-06 13:56:04','<p>Hi {{ fullname }},\r\n<p>Your reservation for zone {{ zone }} in {{ zone_group }} of {{ room.name }} from {{ start_date|date(\'l, j F Y H:i\') }} to {{ end_date|date(\'l, j F Y H:i\') }} has been cancelled.','Reservation of zone {{ zone }} in {{ zone_group }} of {{ room.name }} has been cancelled'),(54,1,3,1,'Overbooked zone reservation notification','zone:new-reservation-overbooked','2020-05-15 23:15:48','2022-05-06 13:57:26','<p>Hi {{ fullname }}\r\n<p>{{ reservation_user }} has made a reservation for zone {{ zone }} in {{ zone_group }} of {{ room }}.\r\n  \r\n<p>This reservation is overbooked so you should check the occupancy in the zone in Equipage, use the link below</a>.\r\n  \r\n<p>{{ deeplink }}\r\n<p>The reservation should start on {{ start_date|date(\'l, j F Y H:i\') }} and ends on {{ end_date|date(\'l, j F Y H:i\') }}.','Reservation of {{ user.parseFullName }} of zone {{ zone }} in {{ zone_group }} of {{ room }} is overbooked'),(55,1,3,1,'Overbooked zone reservation notification (user)','zone:new-reservation-overbooked-user','2020-06-08 19:34:36','2022-05-06 13:58:39','<p>Hi {{ fullname }}\r\n<p>You made a reservation for zone {{ zone }} in {{ zone_group }} of {{ room.name }}.\r\n  \r\n<p>This reservation is overbooked. The room reponsibles have received an email and might take actions\r\n<p>The reservation starts on {{ start_date|date(\'l, j F Y H:i\') }} and ends on {{ end_date|date(\'l, j F Y H:i\') }}.','Reservation zone {{ zone }} in {{ zone_group }} of {{ room.name }} is overbooked'),(67,1,3,1,'New block reservation','equipment:new-reservation-block','2022-05-05 15:53:56','2022-05-06 13:28:08','<p>Hi {{ fullname }}\r\n<p>You made a block reservation on {{ block.reservation.count() }} equipment</p>\r\n<dl>\r\n    <dt>Title</dt>\r\n    <dd>{{ block.reservation.first.title }}</dd>\r\n    <dt>Description</dt>\r\n    <dd>{{ block.reservation.first.description }}</dd>\r\n</dl>\r\n<p>You reserved the following equipment\r\n<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\">\r\n    <tr>\r\n        <th>Equipment</th>\r\n        <th>Date from</th>\r\n        <th>Date end</th>\r\n    </tr>\r\n    {% for reservation in block.reservation %}\r\n        <tr>\r\n            <td>{{ reservation.equipment.parseName() }}</td>\r\n            <td>{{ reservation.endDate|date(\'d-m-Y H:i\') }}</td>\r\n            <td>{{ reservation.startDate|date(\'d-m-Y H:i\') }}</td>\r\n        </tr>\r\n    {% endfor %}\r\n</table>\r\n<br><br>\r\n<p>You can use the following link to view the reservation\r\n<p>{{ deeplink }}','New block reservation for {{ block.reservation.count() }} equipment');

--
-- Table structure for table `mailing_user`
--

CREATE TABLE `mailing_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `mailing_id` int NOT NULL,
  `blocked` smallint NOT NULL,
  `dateSent` datetime DEFAULT NULL,
  `hash` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_DC9F5DFEA76ED395` (`user_id`),
  KEY `IDX_DC9F5DFE3931AB76` (`mailing_id`),
  CONSTRAINT `FK_DC9F5DFE3931AB76` FOREIGN KEY (`mailing_id`) REFERENCES `mailing_mailing` (`id`),
  CONSTRAINT `FK_DC9F5DFEA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mailing_user`
--


--
-- Table structure for table `oauth_access_tokens`
--

CREATE TABLE `oauth_access_tokens` (
  `id` int NOT NULL AUTO_INCREMENT,
  `client_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_id` int DEFAULT NULL,
  `access_token` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `expires` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `scope` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_CA42527C19EB6921` (`client_id`),
  KEY `IDX_CA42527CA76ED395` (`user_id`),
  CONSTRAINT `FK_CA42527C19EB6921` FOREIGN KEY (`client_id`) REFERENCES `oauth_clients` (`client_id`),
  CONSTRAINT `FK_CA42527CA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `oauth_access_tokens`
--


--
-- Table structure for table `oauth_authorization_codes`
--

CREATE TABLE `oauth_authorization_codes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `client_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_id` int DEFAULT NULL,
  `authorization_code` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `expires` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `redirect_uri` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `scope` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `id_token` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_98A471C42F33E8B8` (`authorization_code`),
  KEY `IDX_98A471C419EB6921` (`client_id`),
  KEY `IDX_98A471C4A76ED395` (`user_id`),
  CONSTRAINT `FK_98A471C419EB6921` FOREIGN KEY (`client_id`) REFERENCES `oauth_clients` (`client_id`),
  CONSTRAINT `FK_98A471C4A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `oauth_authorization_codes`
--


--
-- Table structure for table `oauth_clients`
--

CREATE TABLE `oauth_clients` (
  `client_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `scope_id` int NOT NULL,
  `client_secret` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `client_secret_teaser` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `redirect_uri` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `grant_types` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`client_id`),
  KEY `IDX_13CE8101682B5931` (`scope_id`),
  CONSTRAINT `FK_13CE8101682B5931` FOREIGN KEY (`scope_id`) REFERENCES `oauth_scopes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `oauth_clients`
--

INSERT INTO `oauth_clients` VALUES ('03876edc0db55f4909c588b2dbeffe7ee25235a4',1,'$2y$10$E0h0Ed/WvI3BfAD1pMfI2.uKsQqMnNqD7unwtqEQvw4H5c8B71Pfu','JWT Provider','Default client for JWT tokens','Pt*****','https://localhost:3000','authorization_code client_credentials refresh_token password implicit');

--
-- Table structure for table `oauth_jwt`
--

CREATE TABLE `oauth_jwt` (
  `id` int NOT NULL AUTO_INCREMENT,
  `client_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `public_key` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `subject` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_1F0B7D3F19EB6921` (`client_id`),
  CONSTRAINT `FK_1F0B7D3F19EB6921` FOREIGN KEY (`client_id`) REFERENCES `oauth_clients` (`client_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `oauth_jwt`
--


--
-- Table structure for table `oauth_public_keys`
--

CREATE TABLE `oauth_public_keys` (
  `id` int NOT NULL AUTO_INCREMENT,
  `client_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `public_key` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `private_key` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `encryption_algorithm` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_93F2AA9619EB6921` (`client_id`),
  CONSTRAINT `FK_93F2AA9619EB6921` FOREIGN KEY (`client_id`) REFERENCES `oauth_clients` (`client_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `oauth_public_keys`
--


--
-- Table structure for table `oauth_refresh_tokens`
--

CREATE TABLE `oauth_refresh_tokens` (
  `id` int NOT NULL AUTO_INCREMENT,
  `client_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_id` int DEFAULT NULL,
  `refresh_token` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `expires` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `scope` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_5AB687C74F2195` (`refresh_token`),
  KEY `IDX_5AB68719EB6921` (`client_id`),
  KEY `IDX_5AB687A76ED395` (`user_id`),
  CONSTRAINT `FK_5AB68719EB6921` FOREIGN KEY (`client_id`) REFERENCES `oauth_clients` (`client_id`),
  CONSTRAINT `FK_5AB687A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `oauth_refresh_tokens`
--


--
-- Table structure for table `oauth_scopes`
--

CREATE TABLE `oauth_scopes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `scope` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `is_default` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `oauth_scopes`
--

INSERT INTO `oauth_scopes` VALUES (1,'supported','User.Read',1);

--
-- Table structure for table `organisation_group`
--

CREATE TABLE `organisation_group` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `abbr` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` smallint NOT NULL,
  `runNumberPrefix` smallint NOT NULL,
  `customRunNumberPrefix` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `approvalRequired` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_7EEE98935E237E06` (`name`),
  UNIQUE KEY `UNIQ_7EEE98934D4901` (`abbr`),
  UNIQUE KEY `UNIQ_7EEE98935B01C4AC` (`customRunNumberPrefix`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `organisation_group`
--


--
-- Table structure for table `organisation_group_role`
--

CREATE TABLE `organisation_group_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `group_id` int NOT NULL,
  `user_id` int NOT NULL,
  `role_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `startDate` date NOT NULL,
  `endDate` date DEFAULT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_F6DEC728FE54D947` (`group_id`),
  KEY `IDX_F6DEC728A76ED395` (`user_id`),
  KEY `IDX_F6DEC728D60322AC` (`role_id`),
  CONSTRAINT `FK_F6DEC728A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_F6DEC728D60322AC` FOREIGN KEY (`role_id`) REFERENCES `organisation_role` (`id`),
  CONSTRAINT `FK_F6DEC728FE54D947` FOREIGN KEY (`group_id`) REFERENCES `organisation_group` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `organisation_group_role`
--


--
-- Table structure for table `organisation_group_user`
--

CREATE TABLE `organisation_group_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `group_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `startDate` date NOT NULL,
  `endDate` date DEFAULT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_2C249B0BFE54D947` (`group_id`),
  KEY `IDX_2C249B0BA76ED395` (`user_id`),
  CONSTRAINT `FK_2C249B0BA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_2C249B0BFE54D947` FOREIGN KEY (`group_id`) REFERENCES `organisation_group` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `organisation_group_user`
--


--
-- Table structure for table `organisation_project`
--

CREATE TABLE `organisation_project` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `abbr` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `private` smallint NOT NULL,
  `substratesPerPart` smallint NOT NULL,
  `substrateRequirement` smallint NOT NULL,
  `approvalRequired` smallint NOT NULL,
  `startDate` datetime DEFAULT NULL,
  `endDate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_4C37A7ED5E237E06` (`name`),
  UNIQUE KEY `UNIQ_4C37A7ED4D4901` (`abbr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `organisation_project`
--


--
-- Table structure for table `organisation_project_role`
--

CREATE TABLE `organisation_project_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `project_id` int NOT NULL,
  `user_id` int NOT NULL,
  `role_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `startDate` date NOT NULL,
  `endDate` date DEFAULT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_775C2BBF166D1F9C` (`project_id`),
  KEY `IDX_775C2BBFA76ED395` (`user_id`),
  KEY `IDX_775C2BBFD60322AC` (`role_id`),
  CONSTRAINT `FK_775C2BBF166D1F9C` FOREIGN KEY (`project_id`) REFERENCES `organisation_project` (`id`),
  CONSTRAINT `FK_775C2BBFA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_775C2BBFD60322AC` FOREIGN KEY (`role_id`) REFERENCES `organisation_role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `organisation_project_role`
--


--
-- Table structure for table `organisation_project_tag`
--

CREATE TABLE `organisation_project_tag` (
  `id` int NOT NULL AUTO_INCREMENT,
  `project_id` int NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `frontColor` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `backColor` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_59ADD1F6166D1F9C` (`project_id`),
  CONSTRAINT `FK_59ADD1F6166D1F9C` FOREIGN KEY (`project_id`) REFERENCES `organisation_project` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `organisation_project_tag`
--


--
-- Table structure for table `organisation_project_team`
--

CREATE TABLE `organisation_project_team` (
  `project_id` int NOT NULL,
  `team_id` int NOT NULL,
  PRIMARY KEY (`project_id`,`team_id`),
  KEY `IDX_E4D507CA166D1F9C` (`project_id`),
  KEY `IDX_E4D507CA296CD8AE` (`team_id`),
  CONSTRAINT `FK_E4D507CA166D1F9C` FOREIGN KEY (`project_id`) REFERENCES `organisation_project` (`id`),
  CONSTRAINT `FK_E4D507CA296CD8AE` FOREIGN KEY (`team_id`) REFERENCES `organisation_team` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `organisation_project_team`
--


--
-- Table structure for table `organisation_project_user`
--

CREATE TABLE `organisation_project_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `project_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `startDate` date NOT NULL,
  `endDate` date DEFAULT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_ADA6779C166D1F9C` (`project_id`),
  KEY `IDX_ADA6779CA76ED395` (`user_id`),
  CONSTRAINT `FK_ADA6779C166D1F9C` FOREIGN KEY (`project_id`) REFERENCES `organisation_project` (`id`),
  CONSTRAINT `FK_ADA6779CA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `organisation_project_user`
--


--
-- Table structure for table `organisation_role`
--

CREATE TABLE `organisation_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `order` int NOT NULL,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `organisation_role`
--

INSERT INTO `organisation_role` VALUES (1,'Responsible','Responsible user',1,1);

--
-- Table structure for table `organisation_team`
--

CREATE TABLE `organisation_team` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `abbr` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` smallint NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `approvalRequired` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_86A4A6075E237E06` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `organisation_team`
--


--
-- Table structure for table `organisation_team_role`
--

CREATE TABLE `organisation_team_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `team_id` int NOT NULL,
  `user_id` int NOT NULL,
  `role_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `startDate` date NOT NULL,
  `endDate` date DEFAULT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_63C4AAC9296CD8AE` (`team_id`),
  KEY `IDX_63C4AAC9A76ED395` (`user_id`),
  KEY `IDX_63C4AAC9D60322AC` (`role_id`),
  CONSTRAINT `FK_63C4AAC9296CD8AE` FOREIGN KEY (`team_id`) REFERENCES `organisation_team` (`id`),
  CONSTRAINT `FK_63C4AAC9A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_63C4AAC9D60322AC` FOREIGN KEY (`role_id`) REFERENCES `organisation_role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `organisation_team_role`
--


--
-- Table structure for table `organisation_team_user`
--

CREATE TABLE `organisation_team_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `team_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `startDate` date NOT NULL,
  `endDate` date DEFAULT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_B93EF6EA296CD8AE` (`team_id`),
  KEY `IDX_B93EF6EAA76ED395` (`user_id`),
  CONSTRAINT `FK_B93EF6EA296CD8AE` FOREIGN KEY (`team_id`) REFERENCES `organisation_team` (`id`),
  CONSTRAINT `FK_B93EF6EAA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `organisation_team_user`
--


--
-- Table structure for table `page_news`
--

CREATE TABLE `page_news` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `docRef` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `content` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `sticky` smallint NOT NULL,
  `breakingNews` smallint NOT NULL,
  `numViews` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_9A17858A2B36786B` (`title`),
  UNIQUE KEY `UNIQ_9A17858AC335F5CF` (`docRef`),
  KEY `IDX_9A17858AA76ED395` (`user_id`),
  CONSTRAINT `FK_9A17858AA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `page_news`
--


--
-- Table structure for table `page_news_read`
--

CREATE TABLE `page_news_read` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `news_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_76640823A76ED395` (`user_id`),
  KEY `IDX_76640823B5A459A0` (`news_id`),
  CONSTRAINT `FK_76640823A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_76640823B5A459A0` FOREIGN KEY (`news_id`) REFERENCES `page_news` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `page_news_read`
--


--
-- Table structure for table `page_page`
--

CREATE TABLE `page_page` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `docRef` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `content` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `showInNavigation` smallint NOT NULL,
  `numViews` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_93CEAAFA2B36786B` (`title`),
  UNIQUE KEY `UNIQ_93CEAAFAC335F5CF` (`docRef`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `page_page`
--


--
-- Table structure for table `page_page_tree`
--

CREATE TABLE `page_page_tree` (
  `id` int NOT NULL AUTO_INCREMENT,
  `child_page_id` int NOT NULL,
  `parent_page_id` int DEFAULT NULL,
  `sequence` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_B14FDC96EF22BFF` (`child_page_id`),
  KEY `IDX_B14FDC97E0E17A2` (`parent_page_id`),
  CONSTRAINT `FK_B14FDC96EF22BFF` FOREIGN KEY (`child_page_id`) REFERENCES `page_page` (`id`),
  CONSTRAINT `FK_B14FDC97E0E17A2` FOREIGN KEY (`parent_page_id`) REFERENCES `page_page` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `page_page_tree`
--


--
-- Table structure for table `process_category`
--

CREATE TABLE `process_category` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `number` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_category`
--


--
-- Table structure for table `process_category_type`
--

CREATE TABLE `process_category_type` (
  `category_id` int NOT NULL,
  `type_id` int NOT NULL,
  PRIMARY KEY (`category_id`,`type_id`),
  KEY `IDX_56F1930112469DE2` (`category_id`),
  KEY `IDX_56F19301C54C8C93` (`type_id`),
  CONSTRAINT `FK_56F1930112469DE2` FOREIGN KEY (`category_id`) REFERENCES `process_category` (`id`),
  CONSTRAINT `FK_56F19301C54C8C93` FOREIGN KEY (`type_id`) REFERENCES `process_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_category_type`
--


--
-- Table structure for table `process_module`
--

CREATE TABLE `process_module` (
  `id` int NOT NULL AUTO_INCREMENT,
  `process_id` int NOT NULL,
  `module_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `inUse` smallint NOT NULL,
  `isAssemblyProcess` smallint NOT NULL,
  `hasLocalParameters` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_C6C8B88F7EC2F574` (`process_id`),
  KEY `IDX_C6C8B88FAFC2B591` (`module_id`),
  CONSTRAINT `FK_C6C8B88F7EC2F574` FOREIGN KEY (`process_id`) REFERENCES `process_process` (`id`),
  CONSTRAINT `FK_C6C8B88FAFC2B591` FOREIGN KEY (`module_id`) REFERENCES `equipment_module` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_module`
--


--
-- Table structure for table `process_module_hidden_parameter`
--

CREATE TABLE `process_module_hidden_parameter` (
  `process_module_id` int NOT NULL,
  `parameter_id` int NOT NULL,
  PRIMARY KEY (`process_module_id`,`parameter_id`),
  KEY `IDX_8588EB83358BF779` (`process_module_id`),
  KEY `IDX_8588EB837C56DBD6` (`parameter_id`),
  CONSTRAINT `FK_8588EB83358BF779` FOREIGN KEY (`process_module_id`) REFERENCES `process_module` (`id`),
  CONSTRAINT `FK_8588EB837C56DBD6` FOREIGN KEY (`parameter_id`) REFERENCES `process_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_module_hidden_parameter`
--


--
-- Table structure for table `process_module_parameter`
--

CREATE TABLE `process_module_parameter` (
  `id` int NOT NULL AUTO_INCREMENT,
  `process_module_id` int NOT NULL,
  `parameter_id` int NOT NULL,
  `unit_id` int DEFAULT NULL,
  `value` varchar(1000) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sequence` int NOT NULL,
  `fixRange` smallint NOT NULL,
  `minValue` double DEFAULT NULL,
  `maxValue` double DEFAULT NULL,
  `showInName` smallint NOT NULL,
  `required` smallint NOT NULL,
  `header` smallint NOT NULL,
  `locked` smallint NOT NULL,
  `visibility` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_8537F637358BF7797C56DBD6` (`process_module_id`,`parameter_id`),
  KEY `IDX_8537F637358BF779` (`process_module_id`),
  KEY `IDX_8537F6377C56DBD6` (`parameter_id`),
  KEY `IDX_8537F637F8BD700D` (`unit_id`),
  CONSTRAINT `FK_8537F637358BF779` FOREIGN KEY (`process_module_id`) REFERENCES `process_module` (`id`),
  CONSTRAINT `FK_8537F6377C56DBD6` FOREIGN KEY (`parameter_id`) REFERENCES `process_parameter` (`id`),
  CONSTRAINT `FK_8537F637F8BD700D` FOREIGN KEY (`unit_id`) REFERENCES `process_unit` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_module_parameter`
--


--
-- Table structure for table `process_module_parameter_value`
--

CREATE TABLE `process_module_parameter_value` (
  `id` int NOT NULL AUTO_INCREMENT,
  `value` varchar(1000) COLLATE utf8mb3_unicode_ci NOT NULL,
  `moduleParameter_id` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_C3463F33B4F1B802` (`moduleParameter_id`),
  CONSTRAINT `FK_C3463F33B4F1B802` FOREIGN KEY (`moduleParameter_id`) REFERENCES `process_module_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_module_parameter_value`
--


--
-- Table structure for table `process_module_recipe`
--

CREATE TABLE `process_module_recipe` (
  `id` int NOT NULL AUTO_INCREMENT,
  `process_module_id` int NOT NULL,
  `user_id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `status` smallint NOT NULL,
  `subSteps` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_213F4F77358BF779` (`process_module_id`),
  KEY `IDX_213F4F77A76ED395` (`user_id`),
  CONSTRAINT `FK_213F4F77358BF779` FOREIGN KEY (`process_module_id`) REFERENCES `process_module` (`id`),
  CONSTRAINT `FK_213F4F77A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_module_recipe`
--


--
-- Table structure for table `process_module_recipe_changelog`
--

CREATE TABLE `process_module_recipe_changelog` (
  `id` int NOT NULL AUTO_INCREMENT,
  `recipe_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `message` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_A547A6D259D8A214` (`recipe_id`),
  KEY `IDX_A547A6D2A76ED395` (`user_id`),
  CONSTRAINT `FK_A547A6D259D8A214` FOREIGN KEY (`recipe_id`) REFERENCES `process_module_recipe` (`id`),
  CONSTRAINT `FK_A547A6D2A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_module_recipe_changelog`
--


--
-- Table structure for table `process_module_recipe_checklist`
--

CREATE TABLE `process_module_recipe_checklist` (
  `id` int NOT NULL AUTO_INCREMENT,
  `recipe_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `task` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `runChangelogType` int DEFAULT NULL,
  `equipmentModuleChangelogType` int DEFAULT NULL,
  `sequence` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_316CEDFC59D8A214` (`recipe_id`),
  CONSTRAINT `FK_316CEDFC59D8A214` FOREIGN KEY (`recipe_id`) REFERENCES `process_module_recipe` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_module_recipe_checklist`
--


--
-- Table structure for table `process_module_recipe_file`
--

CREATE TABLE `process_module_recipe_file` (
  `recipe_id` int NOT NULL,
  `file_id` int NOT NULL,
  PRIMARY KEY (`recipe_id`,`file_id`),
  KEY `IDX_FA9785F159D8A214` (`recipe_id`),
  KEY `IDX_FA9785F193CB796C` (`file_id`),
  CONSTRAINT `FK_FA9785F159D8A214` FOREIGN KEY (`recipe_id`) REFERENCES `process_module_recipe` (`id`),
  CONSTRAINT `FK_FA9785F193CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_module_recipe_file`
--


--
-- Table structure for table `process_module_recipe_parameter`
--

CREATE TABLE `process_module_recipe_parameter` (
  `id` int NOT NULL AUTO_INCREMENT,
  `recipe_id` int NOT NULL,
  `parameter_id` int NOT NULL,
  `unit_id` int DEFAULT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sequence` int NOT NULL,
  `showInName` smallint NOT NULL,
  `required` smallint NOT NULL,
  `header` smallint NOT NULL,
  `locked` smallint NOT NULL,
  `visibility` smallint NOT NULL,
  `createVariable` tinyint(1) NOT NULL,
  `fixRange` smallint NOT NULL,
  `minValue` double DEFAULT NULL,
  `maxValue` double DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_479211C359D8A214` (`recipe_id`),
  KEY `IDX_479211C37C56DBD6` (`parameter_id`),
  KEY `IDX_479211C3F8BD700D` (`unit_id`),
  CONSTRAINT `FK_479211C359D8A214` FOREIGN KEY (`recipe_id`) REFERENCES `process_module_recipe` (`id`),
  CONSTRAINT `FK_479211C37C56DBD6` FOREIGN KEY (`parameter_id`) REFERENCES `process_parameter` (`id`),
  CONSTRAINT `FK_479211C3F8BD700D` FOREIGN KEY (`unit_id`) REFERENCES `process_unit` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_module_recipe_parameter`
--


--
-- Table structure for table `process_module_recipe_parameter_value`
--

CREATE TABLE `process_module_recipe_parameter_value` (
  `id` int NOT NULL AUTO_INCREMENT,
  `recipe_parameter_id` int NOT NULL,
  `value` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sequence` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_3F2FD4EA365D8CD9` (`recipe_parameter_id`),
  CONSTRAINT `FK_3F2FD4EA365D8CD9` FOREIGN KEY (`recipe_parameter_id`) REFERENCES `process_module_recipe_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_module_recipe_parameter_value`
--


--
-- Table structure for table `process_module_recipe_version`
--

CREATE TABLE `process_module_recipe_version` (
  `id` int NOT NULL AUTO_INCREMENT,
  `recipe_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `version` int NOT NULL,
  `subSteps` int NOT NULL,
  `notes` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_D60F1C6B59D8A214` (`recipe_id`),
  KEY `IDX_D60F1C6BA76ED395` (`user_id`),
  CONSTRAINT `FK_D60F1C6B59D8A214` FOREIGN KEY (`recipe_id`) REFERENCES `process_module_recipe` (`id`),
  CONSTRAINT `FK_D60F1C6BA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_module_recipe_version`
--


--
-- Table structure for table `process_module_recipe_version_checklist`
--

CREATE TABLE `process_module_recipe_version_checklist` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `task` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `runChangelogType` int DEFAULT NULL,
  `equipmentModuleChangelogType` int DEFAULT NULL,
  `sequence` int NOT NULL,
  `recipeVersion_id` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_6335A6035EBCAB2E` (`recipeVersion_id`),
  CONSTRAINT `FK_6335A6035EBCAB2E` FOREIGN KEY (`recipeVersion_id`) REFERENCES `process_module_recipe_version` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_module_recipe_version_checklist`
--


--
-- Table structure for table `process_module_recipe_version_parameter`
--

CREATE TABLE `process_module_recipe_version_parameter` (
  `id` int NOT NULL AUTO_INCREMENT,
  `version_id` int NOT NULL,
  `parameter_id` int NOT NULL,
  `unit_id` int DEFAULT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sequence` int NOT NULL,
  `showInName` smallint NOT NULL,
  `required` smallint NOT NULL,
  `header` smallint NOT NULL,
  `locked` smallint NOT NULL,
  `visibility` smallint NOT NULL,
  `createVariable` tinyint(1) NOT NULL,
  `fixRange` smallint NOT NULL,
  `minValue` double DEFAULT NULL,
  `maxValue` double DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_15CB5A3C4BBC2705` (`version_id`),
  KEY `IDX_15CB5A3C7C56DBD6` (`parameter_id`),
  KEY `IDX_15CB5A3CF8BD700D` (`unit_id`),
  CONSTRAINT `FK_15CB5A3C4BBC2705` FOREIGN KEY (`version_id`) REFERENCES `process_module_recipe_version` (`id`),
  CONSTRAINT `FK_15CB5A3C7C56DBD6` FOREIGN KEY (`parameter_id`) REFERENCES `process_parameter` (`id`),
  CONSTRAINT `FK_15CB5A3CF8BD700D` FOREIGN KEY (`unit_id`) REFERENCES `process_unit` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_module_recipe_version_parameter`
--


--
-- Table structure for table `process_module_recipe_version_parameter_value`
--

CREATE TABLE `process_module_recipe_version_parameter_value` (
  `id` int NOT NULL AUTO_INCREMENT,
  `recipe_parameter_id` int NOT NULL,
  `value` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sequence` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_2DF5AC88365D8CD9` (`recipe_parameter_id`),
  CONSTRAINT `FK_2DF5AC88365D8CD9` FOREIGN KEY (`recipe_parameter_id`) REFERENCES `process_module_recipe_version_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_module_recipe_version_parameter_value`
--


--
-- Table structure for table `process_parameter`
--

CREATE TABLE `process_parameter` (
  `id` int NOT NULL AUTO_INCREMENT,
  `parameter_type_id` int DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `abbr` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_B0DED3F8F123013` (`parameter_type_id`),
  CONSTRAINT `FK_B0DED3F8F123013` FOREIGN KEY (`parameter_type_id`) REFERENCES `process_parameter_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_parameter`
--


--
-- Table structure for table `process_parameter_consumable_type`
--

CREATE TABLE `process_parameter_consumable_type` (
  `parameter_id` int NOT NULL,
  `type_id` int NOT NULL,
  PRIMARY KEY (`parameter_id`,`type_id`),
  KEY `IDX_1C9458367C56DBD6` (`parameter_id`),
  KEY `IDX_1C945836C54C8C93` (`type_id`),
  CONSTRAINT `FK_1C9458367C56DBD6` FOREIGN KEY (`parameter_id`) REFERENCES `process_parameter` (`id`),
  CONSTRAINT `FK_1C945836C54C8C93` FOREIGN KEY (`type_id`) REFERENCES `consumable_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_parameter_consumable_type`
--


--
-- Table structure for table `process_parameter_type`
--

CREATE TABLE `process_parameter_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `abbr` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_FE8C9C5B5E237E06` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_parameter_type`
--


--
-- Table structure for table `process_parameter_type_unit`
--

CREATE TABLE `process_parameter_type_unit` (
  `parameter_type_id` int NOT NULL,
  `unit_id` int NOT NULL,
  PRIMARY KEY (`parameter_type_id`,`unit_id`),
  KEY `IDX_5BDBF259F123013` (`parameter_type_id`),
  KEY `IDX_5BDBF259F8BD700D` (`unit_id`),
  CONSTRAINT `FK_5BDBF259F123013` FOREIGN KEY (`parameter_type_id`) REFERENCES `process_parameter_type` (`id`),
  CONSTRAINT `FK_5BDBF259F8BD700D` FOREIGN KEY (`unit_id`) REFERENCES `process_unit` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_parameter_type_unit`
--


--
-- Table structure for table `process_process`
--

CREATE TABLE `process_process` (
  `id` int NOT NULL AUTO_INCREMENT,
  `category_id` int NOT NULL,
  `user_id` int NOT NULL,
  `version` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `number` int DEFAULT NULL,
  `active` smallint NOT NULL,
  `hasMeasuredValue` smallint NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `private` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_CE65C24312469DE2` (`category_id`),
  KEY `IDX_CE65C243A76ED395` (`user_id`),
  CONSTRAINT `FK_CE65C24312469DE2` FOREIGN KEY (`category_id`) REFERENCES `process_category` (`id`),
  CONSTRAINT `FK_CE65C243A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_process`
--


--
-- Table structure for table `process_process_file`
--

CREATE TABLE `process_process_file` (
  `process_id` int NOT NULL,
  `file_id` int NOT NULL,
  PRIMARY KEY (`process_id`,`file_id`),
  KEY `IDX_9C8B1147EC2F574` (`process_id`),
  KEY `IDX_9C8B11493CB796C` (`file_id`),
  CONSTRAINT `FK_9C8B1147EC2F574` FOREIGN KEY (`process_id`) REFERENCES `process_process` (`id`),
  CONSTRAINT `FK_9C8B11493CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_process_file`
--


--
-- Table structure for table `process_type`
--

CREATE TABLE `process_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `canBeRequirement` smallint NOT NULL,
  `hasColor` smallint NOT NULL,
  `color` varchar(7) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_6337851C5E237E06` (`name`),
  KEY `IDX_6337851CA76ED395` (`user_id`),
  CONSTRAINT `FK_6337851CA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_type`
--


--
-- Table structure for table `process_unit`
--

CREATE TABLE `process_unit` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `abbr` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_3352DE665E237E06` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `process_unit`
--


--
-- Table structure for table `queue_default`
--

CREATE TABLE `queue_default` (
  `id` int NOT NULL AUTO_INCREMENT,
  `queue` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `data` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` smallint NOT NULL,
  `created` datetime NOT NULL,
  `scheduled` datetime NOT NULL,
  `executed` datetime DEFAULT NULL,
  `finished` datetime DEFAULT NULL,
  `priority` int NOT NULL DEFAULT '1024',
  `message` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `trace` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `pop` (`status`,`queue`,`scheduled`,`priority`),
  KEY `prune` (`status`,`queue`,`finished`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `queue_default`
--


--
-- Table structure for table `room_building`
--

CREATE TABLE `room_building` (
  `id` int NOT NULL AUTO_INCREMENT,
  `site_id` int NOT NULL,
  `code` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` smallint NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_4189A11077153098` (`code`),
  UNIQUE KEY `UNIQ_4189A1105E237E06` (`name`),
  KEY `IDX_4189A110F6BD1646` (`site_id`),
  CONSTRAINT `FK_4189A110F6BD1646` FOREIGN KEY (`site_id`) REFERENCES `room_site` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_building`
--


--
-- Table structure for table `room_document`
--

CREATE TABLE `room_document` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `room_id` int NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `date_added` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `filename` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_788F4AB2A76ED395` (`user_id`),
  KEY `IDX_788F4AB254177093` (`room_id`),
  CONSTRAINT `FK_788F4AB254177093` FOREIGN KEY (`room_id`) REFERENCES `room_room` (`id`),
  CONSTRAINT `FK_788F4AB2A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_document`
--


--
-- Table structure for table `room_document_file`
--

CREATE TABLE `room_document_file` (
  `id` int NOT NULL AUTO_INCREMENT,
  `document_id` int NOT NULL,
  `file` longblob NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_429B0A65C33F7837` (`document_id`),
  CONSTRAINT `FK_429B0A65C33F7837` FOREIGN KEY (`document_id`) REFERENCES `room_document` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_document_file`
--


--
-- Table structure for table `room_exit_procedure`
--

CREATE TABLE `room_exit_procedure` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `mentor_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_B918C20BA76ED395` (`user_id`),
  KEY `IDX_B918C20BDB403044` (`mentor_id`),
  CONSTRAINT `FK_B918C20BA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_B918C20BDB403044` FOREIGN KEY (`mentor_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_exit_procedure`
--


--
-- Table structure for table `room_floorplan`
--

CREATE TABLE `room_floorplan` (
  `id` int NOT NULL AUTO_INCREMENT,
  `room_id` int NOT NULL,
  `mimeType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `extension` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fileSize` int NOT NULL,
  `width` int NOT NULL,
  `height` int NOT NULL,
  `type` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `image` longblob NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_29CD0F50541770938CDE5729` (`room_id`,`type`),
  KEY `IDX_29CD0F5054177093` (`room_id`),
  CONSTRAINT `FK_29CD0F5054177093` FOREIGN KEY (`room_id`) REFERENCES `room_room` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_floorplan`
--


--
-- Table structure for table `room_location`
--

CREATE TABLE `room_location` (
  `id` int NOT NULL AUTO_INCREMENT,
  `zone_group_id` int NOT NULL,
  `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `code` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_FE78490F5E237E06` (`name`),
  UNIQUE KEY `UNIQ_FE78490F77153098` (`code`),
  KEY `IDX_FE78490FD6E855DA` (`zone_group_id`),
  CONSTRAINT `FK_FE78490FD6E855DA` FOREIGN KEY (`zone_group_id`) REFERENCES `room_zone_group` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_location`
--


--
-- Table structure for table `room_role`
--

CREATE TABLE `room_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `sequence` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_role`
--


--
-- Table structure for table `room_room`
--

CREATE TABLE `room_room` (
  `id` int NOT NULL AUTO_INCREMENT,
  `building_id` int NOT NULL,
  `name` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `code` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `phone` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  `training_description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_119BBBFF4D2A7E12` (`building_id`),
  CONSTRAINT `FK_119BBBFF4D2A7E12` FOREIGN KEY (`building_id`) REFERENCES `room_building` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_room`
--


--
-- Table structure for table `room_room_link`
--

CREATE TABLE `room_room_link` (
  `id` int NOT NULL AUTO_INCREMENT,
  `room_id` int NOT NULL,
  `type_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_C90193FC54177093` (`room_id`),
  KEY `IDX_C90193FCC54C8C93` (`type_id`),
  CONSTRAINT `FK_C90193FC54177093` FOREIGN KEY (`room_id`) REFERENCES `room_room` (`id`),
  CONSTRAINT `FK_C90193FCC54C8C93` FOREIGN KEY (`type_id`) REFERENCES `room_room_link_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_room_link`
--


--
-- Table structure for table `room_room_link_type`
--

CREATE TABLE `room_room_link_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_E830D214999517A` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_room_link_type`
--


--
-- Table structure for table `room_room_request`
--

CREATE TABLE `room_room_request` (
  `id` int NOT NULL AUTO_INCREMENT,
  `room_id` int NOT NULL,
  `user_id` int NOT NULL,
  `user_mentor_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `hasMentorApproval` tinyint(1) NOT NULL,
  `reason` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `equipment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `materials` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `frequency` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_61C72BEC54177093` (`room_id`),
  KEY `IDX_61C72BECA76ED395` (`user_id`),
  KEY `IDX_61C72BECDBA0BDA0` (`user_mentor_id`),
  CONSTRAINT `FK_61C72BEC54177093` FOREIGN KEY (`room_id`) REFERENCES `room_room` (`id`),
  CONSTRAINT `FK_61C72BECA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_61C72BECDBA0BDA0` FOREIGN KEY (`user_mentor_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_room_request`
--


--
-- Table structure for table `room_room_request_flow`
--

CREATE TABLE `room_room_request_flow` (
  `id` int NOT NULL AUTO_INCREMENT,
  `request_id` int NOT NULL,
  `user_id` int NOT NULL,
  `order` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_7DF47EA9427EB8A5` (`request_id`),
  KEY `IDX_7DF47EA9A76ED395` (`user_id`),
  CONSTRAINT `FK_7DF47EA9427EB8A5` FOREIGN KEY (`request_id`) REFERENCES `room_room_request` (`id`),
  CONSTRAINT `FK_7DF47EA9A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_room_request_flow`
--


--
-- Table structure for table `room_room_role`
--

CREATE TABLE `room_room_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `room_id` int NOT NULL,
  `user_id` int NOT NULL,
  `role_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  `inApprovalFlow` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_A8C4806754177093D60322ACA76ED395` (`room_id`,`role_id`,`user_id`),
  KEY `IDX_A8C4806754177093` (`room_id`),
  KEY `IDX_A8C48067A76ED395` (`user_id`),
  KEY `IDX_A8C48067D60322AC` (`role_id`),
  CONSTRAINT `FK_A8C4806754177093` FOREIGN KEY (`room_id`) REFERENCES `room_room` (`id`),
  CONSTRAINT `FK_A8C48067A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_A8C48067D60322AC` FOREIGN KEY (`role_id`) REFERENCES `room_role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_room_role`
--


--
-- Table structure for table `room_room_user`
--

CREATE TABLE `room_room_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `room_id` int NOT NULL,
  `user_id` int NOT NULL,
  `user_mentor_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_723EDC4454177093A76ED395` (`room_id`,`user_id`),
  KEY `IDX_723EDC4454177093` (`room_id`),
  KEY `IDX_723EDC44A76ED395` (`user_id`),
  KEY `IDX_723EDC44DBA0BDA0` (`user_mentor_id`),
  CONSTRAINT `FK_723EDC4454177093` FOREIGN KEY (`room_id`) REFERENCES `room_room` (`id`),
  CONSTRAINT `FK_723EDC44A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_723EDC44DBA0BDA0` FOREIGN KEY (`user_mentor_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_room_user`
--


--
-- Table structure for table `room_site`
--

CREATE TABLE `room_site` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_A47E38077153098` (`code`),
  UNIQUE KEY `UNIQ_A47E3805E237E06` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_site`
--


--
-- Table structure for table `room_site_floor_plan`
--

CREATE TABLE `room_site_floor_plan` (
  `id` int NOT NULL AUTO_INCREMENT,
  `site_id` int NOT NULL,
  `mimeType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `extension` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fileSize` int NOT NULL,
  `width` int NOT NULL,
  `height` int NOT NULL,
  `type` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `image` longblob NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_12EA91C8F6BD16468CDE5729` (`site_id`,`type`),
  KEY `IDX_12EA91C8F6BD1646` (`site_id`),
  CONSTRAINT `FK_12EA91C8F6BD1646` FOREIGN KEY (`site_id`) REFERENCES `room_site` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_site_floor_plan`
--


--
-- Table structure for table `room_zone`
--

CREATE TABLE `room_zone` (
  `id` int NOT NULL AUTO_INCREMENT,
  `group_id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_C3EF2A63FE54D9475E237E06` (`group_id`,`name`),
  KEY `IDX_C3EF2A63FE54D947` (`group_id`),
  CONSTRAINT `FK_C3EF2A63FE54D947` FOREIGN KEY (`group_id`) REFERENCES `room_zone_group` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_zone`
--


--
-- Table structure for table `room_zone_group`
--

CREATE TABLE `room_zone_group` (
  `id` int NOT NULL AUTO_INCREMENT,
  `room_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `capacity` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_FF1C9B7F5E237E06` (`name`),
  KEY `IDX_FF1C9B7F54177093` (`room_id`),
  CONSTRAINT `FK_FF1C9B7F54177093` FOREIGN KEY (`room_id`) REFERENCES `room_room` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_zone_group`
--


--
-- Table structure for table `room_zone_group_equipment_property`
--

CREATE TABLE `room_zone_group_equipment_property` (
  `group_id` int NOT NULL,
  `property_id` int NOT NULL,
  PRIMARY KEY (`group_id`,`property_id`),
  KEY `IDX_D281E9C2FE54D947` (`group_id`),
  KEY `IDX_D281E9C2549213EC` (`property_id`),
  CONSTRAINT `FK_D281E9C2549213EC` FOREIGN KEY (`property_id`) REFERENCES `equipment_property` (`id`),
  CONSTRAINT `FK_D281E9C2FE54D947` FOREIGN KEY (`group_id`) REFERENCES `room_zone_group` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_zone_group_equipment_property`
--


--
-- Table structure for table `room_zone_reservation`
--

CREATE TABLE `room_zone_reservation` (
  `id` int NOT NULL AUTO_INCREMENT,
  `recurring_link_id` int DEFAULT NULL,
  `user_id` int NOT NULL,
  `zone_id` int NOT NULL,
  `time_start` datetime NOT NULL,
  `time_end` datetime NOT NULL,
  `recurring` smallint NOT NULL,
  `recurringEndDate` datetime DEFAULT NULL,
  `type` smallint NOT NULL,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_6029FB71755297F8` (`recurring_link_id`),
  KEY `IDX_6029FB71A76ED395` (`user_id`),
  KEY `IDX_6029FB719F2C3FAB` (`zone_id`),
  CONSTRAINT `FK_6029FB71755297F8` FOREIGN KEY (`recurring_link_id`) REFERENCES `room_zone_reservation` (`id`),
  CONSTRAINT `FK_6029FB719F2C3FAB` FOREIGN KEY (`zone_id`) REFERENCES `room_zone` (`id`),
  CONSTRAINT `FK_6029FB71A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `room_zone_reservation`
--


--
-- Table structure for table `run_changelog`
--

CREATE TABLE `run_changelog` (
  `id` int NOT NULL AUTO_INCREMENT,
  `run_id` int NOT NULL,
  `user_id` int NOT NULL,
  `runstep_checklist_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `message` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` smallint NOT NULL,
  `source` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_DC32BFD84E3FEC4` (`run_id`),
  KEY `IDX_DC32BFDA76ED395` (`user_id`),
  KEY `IDX_DC32BFDF1964EA4` (`runstep_checklist_id`),
  CONSTRAINT `FK_DC32BFD84E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`),
  CONSTRAINT `FK_DC32BFDA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_DC32BFDF1964EA4` FOREIGN KEY (`runstep_checklist_id`) REFERENCES `run_step_checklist` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_changelog`
--


--
-- Table structure for table `run_changelog_steps`
--

CREATE TABLE `run_changelog_steps` (
  `changelog_id` int NOT NULL,
  `step_id` int NOT NULL,
  PRIMARY KEY (`changelog_id`,`step_id`),
  KEY `IDX_CD2720873C8F0C57` (`changelog_id`),
  KEY `IDX_CD27208773B21E9C` (`step_id`),
  CONSTRAINT `FK_CD2720873C8F0C57` FOREIGN KEY (`changelog_id`) REFERENCES `run_changelog` (`id`),
  CONSTRAINT `FK_CD27208773B21E9C` FOREIGN KEY (`step_id`) REFERENCES `run_step` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_changelog_steps`
--


--
-- Table structure for table `run_consumable`
--

CREATE TABLE `run_consumable` (
  `id` int NOT NULL AUTO_INCREMENT,
  `run_id` int NOT NULL,
  `consumable_id` int NOT NULL,
  `amount` double NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_F0BBCFAF84E3FEC4` (`run_id`),
  KEY `IDX_F0BBCFAFA94ADB61` (`consumable_id`),
  CONSTRAINT `FK_F0BBCFAF84E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`),
  CONSTRAINT `FK_F0BBCFAFA94ADB61` FOREIGN KEY (`consumable_id`) REFERENCES `consumable_consumable` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_consumable`
--


--
-- Table structure for table `run_consumable_matrix_consumable`
--

CREATE TABLE `run_consumable_matrix_consumable` (
  `id` int NOT NULL AUTO_INCREMENT,
  `consumable_matrix_id` int NOT NULL,
  `run_consumable_id` int NOT NULL,
  `consumableNumber` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL COMMENT '(DC2Type:array)',
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_87F3F6021CE453` (`consumable_matrix_id`),
  KEY `IDX_87F3F60A4B47E18` (`run_consumable_id`),
  CONSTRAINT `FK_87F3F6021CE453` FOREIGN KEY (`consumable_matrix_id`) REFERENCES `run_substrate_matrix` (`id`),
  CONSTRAINT `FK_87F3F60A4B47E18` FOREIGN KEY (`run_consumable_id`) REFERENCES `run_consumable` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_consumable_matrix_consumable`
--


--
-- Table structure for table `run_hold_code`
--

CREATE TABLE `run_hold_code` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `frontColor` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `backColor` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `isHold` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_hold_code`
--

INSERT INTO `run_hold_code` VALUES (1,'DEV_INP','Development input','#ffffff','#58d59b','2022-08-12 10:42:53','2022-08-12 10:42:53',1),(2,'ENG_INP','Engineering input','#ffffff','#6600ff','2022-08-12 10:43:32','2022-08-12 10:43:32',1),(3,'EQ-FAIL','Equipment fail','#ffffff','#ee3f3f','2022-08-12 10:45:08','2022-08-12 10:45:08',1),(4,'PLANNED','Planned hold','#ffffff','#66b0ff','2022-08-12 10:45:55','2022-08-12 10:45:55',1);

--
-- Table structure for table `run_measurement`
--

CREATE TABLE `run_measurement` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `sequence` int NOT NULL,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `definition` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `method` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `resultType` smallint NOT NULL,
  `requirement_id` int DEFAULT NULL,
  `loggingParameter_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_EA58CF9C73B21E9C` (`step_id`),
  UNIQUE KEY `UNIQ_EA58CF9C7B576F77` (`requirement_id`),
  KEY `IDX_EA58CF9CC80EE3D9` (`loggingParameter_id`),
  CONSTRAINT `FK_EA58CF9C73B21E9C` FOREIGN KEY (`step_id`) REFERENCES `run_step` (`id`),
  CONSTRAINT `FK_EA58CF9C7B576F77` FOREIGN KEY (`requirement_id`) REFERENCES `run_requirement` (`id`),
  CONSTRAINT `FK_EA58CF9CC80EE3D9` FOREIGN KEY (`loggingParameter_id`) REFERENCES `equipment_logging_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_measurement`
--


--
-- Table structure for table `run_measurement_label`
--

CREATE TABLE `run_measurement_label` (
  `id` int NOT NULL AUTO_INCREMENT,
  `measurement_id` int NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `open` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_2FB2677D924EA134` (`measurement_id`),
  CONSTRAINT `FK_2FB2677D924EA134` FOREIGN KEY (`measurement_id`) REFERENCES `run_measurement` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_measurement_label`
--


--
-- Table structure for table `run_measurement_part`
--

CREATE TABLE `run_measurement_part` (
  `id` int NOT NULL AUTO_INCREMENT,
  `measurement_id` int NOT NULL,
  `step_part_id` int NOT NULL,
  `measuredValue` double DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_E8CC50F2FC1ECD03` (`step_part_id`),
  KEY `IDX_E8CC50F2924EA134` (`measurement_id`),
  CONSTRAINT `FK_E8CC50F2924EA134` FOREIGN KEY (`measurement_id`) REFERENCES `run_measurement` (`id`),
  CONSTRAINT `FK_E8CC50F2FC1ECD03` FOREIGN KEY (`step_part_id`) REFERENCES `run_step_part` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_measurement_part`
--


--
-- Table structure for table `run_measurement_result`
--

CREATE TABLE `run_measurement_result` (
  `id` int NOT NULL AUTO_INCREMENT,
  `measurement_id` int NOT NULL,
  `file_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `uuid` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `runPartMapping_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_932EB3EF924EA134` (`measurement_id`),
  KEY `IDX_932EB3EF579D76A6` (`runPartMapping_id`),
  KEY `IDX_932EB3EF93CB796C` (`file_id`),
  CONSTRAINT `FK_932EB3EF579D76A6` FOREIGN KEY (`runPartMapping_id`) REFERENCES `run_part_mapping` (`id`),
  CONSTRAINT `FK_932EB3EF924EA134` FOREIGN KEY (`measurement_id`) REFERENCES `run_measurement` (`id`),
  CONSTRAINT `FK_932EB3EF93CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_measurement_result`
--


--
-- Table structure for table `run_measurement_result_value`
--

CREATE TABLE `run_measurement_result_value` (
  `id` int NOT NULL AUTO_INCREMENT,
  `result_id` int NOT NULL,
  `floatValue` double DEFAULT NULL,
  `stringValue` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `intValue` int DEFAULT NULL,
  `stdDev` double DEFAULT NULL,
  `unit` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `loggingParameter_id` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_9882B19F7A7B643` (`result_id`),
  KEY `IDX_9882B19FC80EE3D9` (`loggingParameter_id`),
  CONSTRAINT `FK_9882B19F7A7B643` FOREIGN KEY (`result_id`) REFERENCES `run_measurement_result` (`id`),
  CONSTRAINT `FK_9882B19FC80EE3D9` FOREIGN KEY (`loggingParameter_id`) REFERENCES `equipment_logging_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_measurement_result_value`
--


--
-- Table structure for table `run_measurement_summary`
--

CREATE TABLE `run_measurement_summary` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `title` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_7AA39C26A76ED395` (`user_id`),
  CONSTRAINT `FK_7AA39C26A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_measurement_summary`
--


--
-- Table structure for table `run_measurement_summary_run`
--

CREATE TABLE `run_measurement_summary_run` (
  `id` int NOT NULL AUTO_INCREMENT,
  `summary_id` int NOT NULL,
  `run_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_59B77B442AC2D45C` (`summary_id`),
  KEY `IDX_59B77B4484E3FEC4` (`run_id`),
  CONSTRAINT `FK_59B77B442AC2D45C` FOREIGN KEY (`summary_id`) REFERENCES `run_measurement_summary` (`id`),
  CONSTRAINT `FK_59B77B4484E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_measurement_summary_run`
--


--
-- Table structure for table `run_measurement_summary_run_part`
--

CREATE TABLE `run_measurement_summary_run_part` (
  `id` int NOT NULL AUTO_INCREMENT,
  `summary_id` int NOT NULL,
  `part_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `sequence` int NOT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_AE0FD7412AC2D45C` (`summary_id`),
  KEY `IDX_AE0FD7414CE34BEC` (`part_id`),
  CONSTRAINT `FK_AE0FD7412AC2D45C` FOREIGN KEY (`summary_id`) REFERENCES `run_measurement_summary` (`id`),
  CONSTRAINT `FK_AE0FD7414CE34BEC` FOREIGN KEY (`part_id`) REFERENCES `run_part` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_measurement_summary_run_part`
--


--
-- Table structure for table `run_parent`
--

CREATE TABLE `run_parent` (
  `id` int NOT NULL AUTO_INCREMENT,
  `parent_run_id` int NOT NULL,
  `run_id` int NOT NULL,
  `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `open` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_37B25172CBF03D02` (`parent_run_id`),
  KEY `IDX_37B2517284E3FEC4` (`run_id`),
  CONSTRAINT `FK_37B2517284E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`),
  CONSTRAINT `FK_37B25172CBF03D02` FOREIGN KEY (`parent_run_id`) REFERENCES `run_run` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_parent`
--


--
-- Table structure for table `run_parent_part`
--

CREATE TABLE `run_parent_part` (
  `run_parent_id` int NOT NULL,
  `part_id` int NOT NULL,
  PRIMARY KEY (`run_parent_id`,`part_id`),
  KEY `IDX_B25451FFB7FBC78C` (`run_parent_id`),
  KEY `IDX_B25451FF4CE34BEC` (`part_id`),
  CONSTRAINT `FK_B25451FF4CE34BEC` FOREIGN KEY (`part_id`) REFERENCES `run_part` (`id`),
  CONSTRAINT `FK_B25451FFB7FBC78C` FOREIGN KEY (`run_parent_id`) REFERENCES `run_parent` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_parent_part`
--


--
-- Table structure for table `run_part`
--

CREATE TABLE `run_part` (
  `id` int NOT NULL AUTO_INCREMENT,
  `run_id` int NOT NULL,
  `partId` smallint NOT NULL,
  `shortLabel` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `layout_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_D5F12FE284E3FEC4` (`run_id`),
  KEY `IDX_D5F12FE28C22AA1A` (`layout_id`),
  CONSTRAINT `FK_D5F12FE284E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`),
  CONSTRAINT `FK_D5F12FE28C22AA1A` FOREIGN KEY (`layout_id`) REFERENCES `run_part_layout` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_part`
--


--
-- Table structure for table `run_part_consumable_creation`
--

CREATE TABLE `run_part_consumable_creation` (
  `id` int NOT NULL AUTO_INCREMENT,
  `part_id` int NOT NULL,
  `consumable_id` int NOT NULL,
  `amount` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_37E6748B4CE34BEC` (`part_id`),
  UNIQUE KEY `UNIQ_37E6748BA94ADB61` (`consumable_id`),
  CONSTRAINT `FK_37E6748B4CE34BEC` FOREIGN KEY (`part_id`) REFERENCES `run_part` (`id`),
  CONSTRAINT `FK_37E6748BA94ADB61` FOREIGN KEY (`consumable_id`) REFERENCES `consumable_consumable` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_part_consumable_creation`
--


--
-- Table structure for table `run_part_layout`
--

CREATE TABLE `run_part_layout` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8mb3_unicode_ci,
  `format` smallint NOT NULL,
  `width` smallint NOT NULL,
  `height` smallint NOT NULL,
  `amountOfDevices` smallint NOT NULL,
  `deviceWidth` smallint NOT NULL,
  `deviceHeight` smallint NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_part_layout`
--


--
-- Table structure for table `run_part_mapping`
--

CREATE TABLE `run_part_mapping` (
  `id` int NOT NULL AUTO_INCREMENT,
  `part_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `mapId` smallint NOT NULL,
  `label` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `xCoordinate` int NOT NULL,
  `yCoordinate` int NOT NULL,
  `width` int NOT NULL,
  `height` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_5A759C0B4CE34BEC` (`part_id`),
  CONSTRAINT `FK_5A759C0B4CE34BEC` FOREIGN KEY (`part_id`) REFERENCES `run_part` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_part_mapping`
--


--
-- Table structure for table `run_priority`
--

CREATE TABLE `run_priority` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `order` int NOT NULL,
  `frontColor` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `backColor` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_priority`
--

INSERT INTO `run_priority` VALUES (1,'HOT','Hot lots',1000,'#000000','#f07070','2022-08-12 10:46:57','2022-08-12 10:46:57'),(2,'LOW','Low prio',-100,'#030303','#99df8b','2022-08-12 10:47:34','2022-08-12 10:47:34'),(3,'PRIO','',100,'#000000','#f3a216','2022-08-12 10:47:59','2022-08-12 10:47:59');

--
-- Table structure for table `run_related`
--

CREATE TABLE `run_related` (
  `parent_run_id` int NOT NULL,
  `child_run_id` int NOT NULL,
  PRIMARY KEY (`parent_run_id`,`child_run_id`),
  KEY `IDX_383500B0CBF03D02` (`parent_run_id`),
  KEY `IDX_383500B0EDB63A98` (`child_run_id`),
  CONSTRAINT `FK_383500B0CBF03D02` FOREIGN KEY (`parent_run_id`) REFERENCES `run_run` (`id`),
  CONSTRAINT `FK_383500B0EDB63A98` FOREIGN KEY (`child_run_id`) REFERENCES `run_run` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_related`
--


--
-- Table structure for table `run_requirement`
--

CREATE TABLE `run_requirement` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `requirement_step_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `sequence` int NOT NULL,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `definition` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `method` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `minValue` double DEFAULT NULL,
  `maxValue` double DEFAULT NULL,
  `target` double DEFAULT NULL,
  `inclusive` smallint NOT NULL,
  `unit` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `loggingParameter_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_1D8742DD73B21E9C` (`step_id`),
  KEY `IDX_1D8742DD28383107` (`requirement_step_id`),
  KEY `IDX_1D8742DDC80EE3D9` (`loggingParameter_id`),
  CONSTRAINT `FK_1D8742DD28383107` FOREIGN KEY (`requirement_step_id`) REFERENCES `run_step` (`id`),
  CONSTRAINT `FK_1D8742DD73B21E9C` FOREIGN KEY (`step_id`) REFERENCES `run_step` (`id`),
  CONSTRAINT `FK_1D8742DDC80EE3D9` FOREIGN KEY (`loggingParameter_id`) REFERENCES `equipment_logging_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_requirement`
--


--
-- Table structure for table `run_requirement_label`
--

CREATE TABLE `run_requirement_label` (
  `id` int NOT NULL AUTO_INCREMENT,
  `requirement_id` int NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `open` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_6C7C060D7B576F77` (`requirement_id`),
  CONSTRAINT `FK_6C7C060D7B576F77` FOREIGN KEY (`requirement_id`) REFERENCES `run_requirement` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_requirement_label`
--


--
-- Table structure for table `run_requirement_part`
--

CREATE TABLE `run_requirement_part` (
  `id` int NOT NULL AUTO_INCREMENT,
  `requirement_id` int NOT NULL,
  `step_part_id` int NOT NULL,
  `maxValue` double NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_4F444A9AFC1ECD03` (`step_part_id`),
  KEY `IDX_4F444A9A7B576F77` (`requirement_id`),
  CONSTRAINT `FK_4F444A9A7B576F77` FOREIGN KEY (`requirement_id`) REFERENCES `run_requirement` (`id`),
  CONSTRAINT `FK_4F444A9AFC1ECD03` FOREIGN KEY (`step_part_id`) REFERENCES `run_step_part` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_requirement_part`
--


--
-- Table structure for table `run_role`
--

CREATE TABLE `run_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `order` int NOT NULL,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_role`
--


--
-- Table structure for table `run_run`
--

CREATE TABLE `run_run` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `project_id` int NOT NULL,
  `team_id` int NOT NULL,
  `group_id` int NOT NULL,
  `number` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `location` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `motivation` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `conclusion` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `dateCreated` datetime NOT NULL,
  `startDate` datetime DEFAULT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `finishDate` datetime DEFAULT NULL,
  `parts` smallint NOT NULL,
  `status` smallint NOT NULL,
  `standard` smallint NOT NULL,
  `labelType` smallint NOT NULL,
  `hasApproval` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_A72F2904A76ED395` (`user_id`),
  KEY `IDX_A72F2904166D1F9C` (`project_id`),
  KEY `IDX_A72F2904296CD8AE` (`team_id`),
  KEY `IDX_A72F2904FE54D947` (`group_id`),
  CONSTRAINT `FK_A72F2904166D1F9C` FOREIGN KEY (`project_id`) REFERENCES `organisation_project` (`id`),
  CONSTRAINT `FK_A72F2904296CD8AE` FOREIGN KEY (`team_id`) REFERENCES `organisation_team` (`id`),
  CONSTRAINT `FK_A72F2904A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_A72F2904FE54D947` FOREIGN KEY (`group_id`) REFERENCES `organisation_group` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_run`
--


--
-- Table structure for table `run_run_batch_card`
--

CREATE TABLE `run_run_batch_card` (
  `id` int NOT NULL AUTO_INCREMENT,
  `run_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `content` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_1B6A7A2B84E3FEC4` (`run_id`),
  KEY `IDX_1B6A7A2BA76ED395` (`user_id`),
  CONSTRAINT `FK_1B6A7A2B84E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`),
  CONSTRAINT `FK_1B6A7A2BA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_run_batch_card`
--


--
-- Table structure for table `run_run_file`
--

CREATE TABLE `run_run_file` (
  `run_id` int NOT NULL,
  `file_id` int NOT NULL,
  PRIMARY KEY (`run_id`,`file_id`),
  KEY `IDX_2B572B8C84E3FEC4` (`run_id`),
  KEY `IDX_2B572B8C93CB796C` (`file_id`),
  CONSTRAINT `FK_2B572B8C84E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`),
  CONSTRAINT `FK_2B572B8C93CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_run_file`
--


--
-- Table structure for table `run_run_hold_code`
--

CREATE TABLE `run_run_hold_code` (
  `id` int NOT NULL AUTO_INCREMENT,
  `run_id` int NOT NULL,
  `user_id` int NOT NULL,
  `active` smallint NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `holdCode_id` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_F367F1C384E3FEC4` (`run_id`),
  KEY `IDX_F367F1C33A815D68` (`holdCode_id`),
  KEY `IDX_F367F1C3A76ED395` (`user_id`),
  CONSTRAINT `FK_F367F1C33A815D68` FOREIGN KEY (`holdCode_id`) REFERENCES `run_hold_code` (`id`),
  CONSTRAINT `FK_F367F1C384E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`),
  CONSTRAINT `FK_F367F1C3A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_run_hold_code`
--


--
-- Table structure for table `run_run_priority`
--

CREATE TABLE `run_run_priority` (
  `id` int NOT NULL AUTO_INCREMENT,
  `run_id` int NOT NULL,
  `priority_id` int NOT NULL,
  `user_id` int NOT NULL,
  `active` smallint NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_CA5FD91584E3FEC4` (`run_id`),
  KEY `IDX_CA5FD915497B19F9` (`priority_id`),
  KEY `IDX_CA5FD915A76ED395` (`user_id`),
  CONSTRAINT `FK_CA5FD915497B19F9` FOREIGN KEY (`priority_id`) REFERENCES `run_priority` (`id`),
  CONSTRAINT `FK_CA5FD91584E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`),
  CONSTRAINT `FK_CA5FD915A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_run_priority`
--


--
-- Table structure for table `run_run_role`
--

CREATE TABLE `run_run_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `run_id` int NOT NULL,
  `user_id` int NOT NULL,
  `role_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_F0A197F684E3FEC4` (`run_id`),
  KEY `IDX_F0A197F6A76ED395` (`user_id`),
  KEY `IDX_F0A197F6D60322AC` (`role_id`),
  CONSTRAINT `FK_F0A197F684E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`),
  CONSTRAINT `FK_F0A197F6A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_F0A197F6D60322AC` FOREIGN KEY (`role_id`) REFERENCES `run_role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_run_role`
--


--
-- Table structure for table `run_run_variable`
--

CREATE TABLE `run_run_variable` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `stepParameterValue_id` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_64B482BF569A494C` (`stepParameterValue_id`),
  CONSTRAINT `FK_64B482BF569A494C` FOREIGN KEY (`stepParameterValue_id`) REFERENCES `run_step_parameter_value` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_run_variable`
--


--
-- Table structure for table `run_service_work`
--

CREATE TABLE `run_service_work` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `run_id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `finishDate` datetime DEFAULT NULL,
  `instructions` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `dispatched` smallint NOT NULL,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_EC29BE6A76ED395` (`user_id`),
  KEY `IDX_EC29BE684E3FEC4` (`run_id`),
  CONSTRAINT `FK_EC29BE684E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`),
  CONSTRAINT `FK_EC29BE6A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_service_work`
--


--
-- Table structure for table `run_service_work_comment`
--

CREATE TABLE `run_service_work_comment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `service_work_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_AB5CBCEF74B00147` (`service_work_id`),
  KEY `IDX_AB5CBCEFA76ED395` (`user_id`),
  CONSTRAINT `FK_AB5CBCEF74B00147` FOREIGN KEY (`service_work_id`) REFERENCES `run_service_work` (`id`),
  CONSTRAINT `FK_AB5CBCEFA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_service_work_comment`
--


--
-- Table structure for table `run_service_work_step`
--

CREATE TABLE `run_service_work_step` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `service_work_id` int NOT NULL,
  `step_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `startDate` datetime DEFAULT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `finishDate` datetime DEFAULT NULL,
  `remark` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `instructions` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_DFE1B55D73B21E9C` (`step_id`),
  KEY `IDX_DFE1B55DA76ED395` (`user_id`),
  KEY `IDX_DFE1B55D74B00147` (`service_work_id`),
  CONSTRAINT `FK_DFE1B55D73B21E9C` FOREIGN KEY (`step_id`) REFERENCES `run_step` (`id`),
  CONSTRAINT `FK_DFE1B55D74B00147` FOREIGN KEY (`service_work_id`) REFERENCES `run_service_work` (`id`),
  CONSTRAINT `FK_DFE1B55DA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_service_work_step`
--


--
-- Table structure for table `run_step`
--

CREATE TABLE `run_step` (
  `id` int NOT NULL AUTO_INCREMENT,
  `run_id` int NOT NULL,
  `user_id` int NOT NULL,
  `start_user_id` int DEFAULT NULL,
  `finish_user_id` int DEFAULT NULL,
  `processmodule_id` int NOT NULL,
  `template_step_id` int DEFAULT NULL,
  `monitor_step_id` int DEFAULT NULL,
  `stepgroup_id` int DEFAULT NULL,
  `process_module_recipe_version_id` int DEFAULT NULL,
  `sequence` int NOT NULL,
  `number` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `startDate` datetime DEFAULT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `finishDate` datetime DEFAULT NULL,
  `dateSkipped` datetime DEFAULT NULL,
  `time` datetime DEFAULT NULL,
  `private` smallint NOT NULL,
  `version` int NOT NULL,
  `subSteps` int NOT NULL,
  `standard` smallint NOT NULL,
  `hasParts` smallint NOT NULL,
  `remark` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `instructions` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  `upToDate` smallint NOT NULL,
  `processName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `stepVersion` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_DF47A11884E3FEC4` (`run_id`),
  KEY `IDX_DF47A118A76ED395` (`user_id`),
  KEY `IDX_DF47A11857AB8F46` (`start_user_id`),
  KEY `IDX_DF47A1188AF98AE3` (`finish_user_id`),
  KEY `IDX_DF47A11877F3AE70` (`processmodule_id`),
  KEY `IDX_DF47A118200A65A5` (`template_step_id`),
  KEY `IDX_DF47A11820DE3AF7` (`monitor_step_id`),
  KEY `IDX_DF47A1183AE1BED5` (`stepgroup_id`),
  KEY `IDX_DF47A118540BA1EB` (`process_module_recipe_version_id`),
  CONSTRAINT `FK_DF47A118200A65A5` FOREIGN KEY (`template_step_id`) REFERENCES `template_step` (`id`),
  CONSTRAINT `FK_DF47A11820DE3AF7` FOREIGN KEY (`monitor_step_id`) REFERENCES `equipment_monitor_step` (`id`),
  CONSTRAINT `FK_DF47A1183AE1BED5` FOREIGN KEY (`stepgroup_id`) REFERENCES `run_step_group` (`id`),
  CONSTRAINT `FK_DF47A118540BA1EB` FOREIGN KEY (`process_module_recipe_version_id`) REFERENCES `process_module_recipe_version` (`id`),
  CONSTRAINT `FK_DF47A11857AB8F46` FOREIGN KEY (`start_user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_DF47A11877F3AE70` FOREIGN KEY (`processmodule_id`) REFERENCES `process_module` (`id`),
  CONSTRAINT `FK_DF47A11884E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`),
  CONSTRAINT `FK_DF47A1188AF98AE3` FOREIGN KEY (`finish_user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_DF47A118A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_step`
--


--
-- Table structure for table `run_step_checklist`
--

CREATE TABLE `run_step_checklist` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `dateExecuted` datetime DEFAULT NULL,
  `task` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `sequence` int NOT NULL,
  `runChangelogType` int DEFAULT NULL,
  `equipmentModuleChangelogType` int DEFAULT NULL,
  `runStep_id` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_A88023D94F00F1BE` (`runStep_id`),
  KEY `IDX_A88023D9A76ED395` (`user_id`),
  CONSTRAINT `FK_A88023D94F00F1BE` FOREIGN KEY (`runStep_id`) REFERENCES `run_step` (`id`),
  CONSTRAINT `FK_A88023D9A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_step_checklist`
--


--
-- Table structure for table `run_step_file`
--

CREATE TABLE `run_step_file` (
  `step_id` int NOT NULL,
  `file_id` int NOT NULL,
  PRIMARY KEY (`step_id`,`file_id`),
  KEY `IDX_788A6BD73B21E9C` (`step_id`),
  KEY `IDX_788A6BD93CB796C` (`file_id`),
  CONSTRAINT `FK_788A6BD73B21E9C` FOREIGN KEY (`step_id`) REFERENCES `run_step` (`id`),
  CONSTRAINT `FK_788A6BD93CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_step_file`
--


--
-- Table structure for table `run_step_group`
--

CREATE TABLE `run_step_group` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `locked` smallint NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_step_group`
--


--
-- Table structure for table `run_step_label`
--

CREATE TABLE `run_step_label` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `open` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_A64B982D73B21E9C` (`step_id`),
  CONSTRAINT `FK_A64B982D73B21E9C` FOREIGN KEY (`step_id`) REFERENCES `run_step` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_step_label`
--


--
-- Table structure for table `run_step_logging`
--

CREATE TABLE `run_step_logging` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `file_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `data` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_E9A7A39F93CB796C` (`file_id`),
  KEY `IDX_E9A7A39F73B21E9C` (`step_id`),
  CONSTRAINT `FK_E9A7A39F73B21E9C` FOREIGN KEY (`step_id`) REFERENCES `run_step` (`id`),
  CONSTRAINT `FK_E9A7A39F93CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_step_logging`
--


--
-- Table structure for table `run_step_parameter`
--

CREATE TABLE `run_step_parameter` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `parameter_id` int NOT NULL,
  `unit_id` int DEFAULT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `version` int NOT NULL,
  `sequence` int NOT NULL,
  `showInName` smallint NOT NULL,
  `required` smallint NOT NULL,
  `header` smallint NOT NULL,
  `locked` smallint NOT NULL,
  `visibility` smallint NOT NULL,
  `fixRange` smallint NOT NULL,
  `minValue` double DEFAULT NULL,
  `maxValue` double DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_DE7EDFE673B21E9C` (`step_id`),
  KEY `IDX_DE7EDFE67C56DBD6` (`parameter_id`),
  KEY `IDX_DE7EDFE6F8BD700D` (`unit_id`),
  CONSTRAINT `FK_DE7EDFE673B21E9C` FOREIGN KEY (`step_id`) REFERENCES `run_step` (`id`),
  CONSTRAINT `FK_DE7EDFE67C56DBD6` FOREIGN KEY (`parameter_id`) REFERENCES `process_parameter` (`id`),
  CONSTRAINT `FK_DE7EDFE6F8BD700D` FOREIGN KEY (`unit_id`) REFERENCES `process_unit` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_step_parameter`
--


--
-- Table structure for table `run_step_parameter_value`
--

CREATE TABLE `run_step_parameter_value` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_parameter_id` int NOT NULL,
  `consumable_id` int DEFAULT NULL,
  `value` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sequence` int NOT NULL,
  `assemblyRunStep_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_50006B2A47392C04` (`step_parameter_id`),
  KEY `IDX_50006B2AA94ADB61` (`consumable_id`),
  KEY `IDX_50006B2AC1D39F08` (`assemblyRunStep_id`),
  CONSTRAINT `FK_50006B2A47392C04` FOREIGN KEY (`step_parameter_id`) REFERENCES `run_step_parameter` (`id`),
  CONSTRAINT `FK_50006B2AA94ADB61` FOREIGN KEY (`consumable_id`) REFERENCES `consumable_consumable` (`id`),
  CONSTRAINT `FK_50006B2AC1D39F08` FOREIGN KEY (`assemblyRunStep_id`) REFERENCES `run_step` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_step_parameter_value`
--


--
-- Table structure for table `run_step_parameter_value_realised`
--

CREATE TABLE `run_step_parameter_value_realised` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_parameter_value_id` int NOT NULL,
  `value` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_376FC111FACBBA73` (`step_parameter_value_id`),
  CONSTRAINT `FK_376FC111FACBBA73` FOREIGN KEY (`step_parameter_value_id`) REFERENCES `run_step_parameter_value` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_step_parameter_value_realised`
--


--
-- Table structure for table `run_step_part`
--

CREATE TABLE `run_step_part` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `part_id` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_C218E06B73B21E9C` (`step_id`),
  KEY `IDX_C218E06B4CE34BEC` (`part_id`),
  CONSTRAINT `FK_C218E06B4CE34BEC` FOREIGN KEY (`part_id`) REFERENCES `run_part` (`id`),
  CONSTRAINT `FK_C218E06B73B21E9C` FOREIGN KEY (`step_id`) REFERENCES `run_step` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_step_part`
--


--
-- Table structure for table `run_step_rework`
--

CREATE TABLE `run_step_rework` (
  `id` int NOT NULL AUTO_INCREMENT,
  `run_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_3F56983F84E3FEC4` (`run_id`),
  CONSTRAINT `FK_3F56983F84E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_step_rework`
--


--
-- Table structure for table `run_step_rework_new_step`
--

CREATE TABLE `run_step_rework_new_step` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `rework_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_2150C63373B21E9C` (`step_id`),
  KEY `IDX_2150C633860FDD87` (`rework_id`),
  CONSTRAINT `FK_2150C63373B21E9C` FOREIGN KEY (`step_id`) REFERENCES `run_step` (`id`),
  CONSTRAINT `FK_2150C633860FDD87` FOREIGN KEY (`rework_id`) REFERENCES `run_step_rework` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_step_rework_new_step`
--


--
-- Table structure for table `run_step_rework_reworked_step`
--

CREATE TABLE `run_step_rework_reworked_step` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `rework_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_27F12CA873B21E9C` (`step_id`),
  KEY `IDX_27F12CA8860FDD87` (`rework_id`),
  CONSTRAINT `FK_27F12CA873B21E9C` FOREIGN KEY (`step_id`) REFERENCES `run_step` (`id`),
  CONSTRAINT `FK_27F12CA8860FDD87` FOREIGN KEY (`rework_id`) REFERENCES `run_step_rework` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_step_rework_reworked_step`
--


--
-- Table structure for table `run_step_tag`
--

CREATE TABLE `run_step_tag` (
  `step_id` int NOT NULL,
  `tag_id` int NOT NULL,
  PRIMARY KEY (`step_id`,`tag_id`),
  KEY `IDX_AAA1F0D973B21E9C` (`step_id`),
  KEY `IDX_AAA1F0D9BAD26311` (`tag_id`),
  CONSTRAINT `FK_AAA1F0D973B21E9C` FOREIGN KEY (`step_id`) REFERENCES `run_step` (`id`),
  CONSTRAINT `FK_AAA1F0D9BAD26311` FOREIGN KEY (`tag_id`) REFERENCES `organisation_project_tag` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_step_tag`
--


--
-- Table structure for table `run_substrate`
--

CREATE TABLE `run_substrate` (
  `id` int NOT NULL AUTO_INCREMENT,
  `run_id` int NOT NULL,
  `substrate_id` int NOT NULL,
  `amount` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_6D73FD3F84E3FEC4` (`run_id`),
  KEY `IDX_6D73FD3FB2A79F0C` (`substrate_id`),
  CONSTRAINT `FK_6D73FD3F84E3FEC4` FOREIGN KEY (`run_id`) REFERENCES `run_run` (`id`),
  CONSTRAINT `FK_6D73FD3FB2A79F0C` FOREIGN KEY (`substrate_id`) REFERENCES `substrate_substrate` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_substrate`
--


--
-- Table structure for table `run_substrate_matrix`
--

CREATE TABLE `run_substrate_matrix` (
  `id` int NOT NULL AUTO_INCREMENT,
  `part_id` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_8119CCF14CE34BEC` (`part_id`),
  CONSTRAINT `FK_8119CCF14CE34BEC` FOREIGN KEY (`part_id`) REFERENCES `run_part` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_substrate_matrix`
--


--
-- Table structure for table `run_substrate_matrix_parent_part`
--

CREATE TABLE `run_substrate_matrix_parent_part` (
  `substrate_matrix_id` int NOT NULL,
  `parent_part_id` int NOT NULL,
  PRIMARY KEY (`substrate_matrix_id`,`parent_part_id`),
  KEY `IDX_F45F566E2BE852FC` (`substrate_matrix_id`),
  KEY `IDX_F45F566E3EAB3FAA` (`parent_part_id`),
  CONSTRAINT `FK_F45F566E2BE852FC` FOREIGN KEY (`substrate_matrix_id`) REFERENCES `run_substrate_matrix` (`id`),
  CONSTRAINT `FK_F45F566E3EAB3FAA` FOREIGN KEY (`parent_part_id`) REFERENCES `run_part` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_substrate_matrix_parent_part`
--


--
-- Table structure for table `run_substrate_matrix_substrate`
--

CREATE TABLE `run_substrate_matrix_substrate` (
  `id` int NOT NULL AUTO_INCREMENT,
  `substrate_matrix_id` int NOT NULL,
  `run_substrate_id` int NOT NULL,
  `substrateNumber` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL COMMENT '(DC2Type:array)',
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_9868D632BE852FC` (`substrate_matrix_id`),
  KEY `IDX_9868D632168D886` (`run_substrate_id`),
  CONSTRAINT `FK_9868D632168D886` FOREIGN KEY (`run_substrate_id`) REFERENCES `run_substrate` (`id`),
  CONSTRAINT `FK_9868D632BE852FC` FOREIGN KEY (`substrate_matrix_id`) REFERENCES `run_substrate_matrix` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `run_substrate_matrix_substrate`
--


--
-- Table structure for table `sensor_calibration_type`
--

CREATE TABLE `sensor_calibration_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `color` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_11C532305E237E06` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_calibration_type`
--


--
-- Table structure for table `sensor_calibration_type_property`
--

CREATE TABLE `sensor_calibration_type_property` (
  `type_id` int NOT NULL,
  `property_id` int NOT NULL,
  PRIMARY KEY (`type_id`,`property_id`),
  KEY `IDX_1A44AC7EC54C8C93` (`type_id`),
  KEY `IDX_1A44AC7E549213EC` (`property_id`),
  CONSTRAINT `FK_1A44AC7E549213EC` FOREIGN KEY (`property_id`) REFERENCES `sensor_property` (`id`),
  CONSTRAINT `FK_1A44AC7EC54C8C93` FOREIGN KEY (`type_id`) REFERENCES `sensor_calibration_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_calibration_type_property`
--


--
-- Table structure for table `sensor_property`
--

CREATE TABLE `sensor_property` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `property` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `label` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `showInList` smallint NOT NULL,
  `values` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `unit` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sort` smallint NOT NULL,
  `friendlyText` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `defaultValue` longtext COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_property`
--


--
-- Table structure for table `sensor_sensor`
--

CREATE TABLE `sensor_sensor` (
  `id` int NOT NULL AUTO_INCREMENT,
  `owner_id` int NOT NULL,
  `requester_id` int NOT NULL,
  `project_id` int NOT NULL,
  `site_id` int NOT NULL,
  `applicationSensor` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `number` smallint NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `vendor_id` int DEFAULT NULL,
  `localIdentifier` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `label` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_121139A096901F54` (`number`),
  KEY `IDX_121139A07E3C61F9` (`owner_id`),
  KEY `IDX_121139A0ED442CF4` (`requester_id`),
  KEY `IDX_121139A0166D1F9C` (`project_id`),
  KEY `IDX_121139A0F6BD1646` (`site_id`),
  KEY `IDX_121139A0F603EE73` (`vendor_id`),
  CONSTRAINT `FK_121139A0166D1F9C` FOREIGN KEY (`project_id`) REFERENCES `organisation_project` (`id`),
  CONSTRAINT `FK_121139A07E3C61F9` FOREIGN KEY (`owner_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_121139A0ED442CF4` FOREIGN KEY (`requester_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_121139A0F603EE73` FOREIGN KEY (`vendor_id`) REFERENCES `sensor_vendor` (`id`),
  CONSTRAINT `FK_121139A0F6BD1646` FOREIGN KEY (`site_id`) REFERENCES `room_site` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_sensor`
--


--
-- Table structure for table `sensor_sensor_calibration`
--

CREATE TABLE `sensor_sensor_calibration` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `sensor_id` int NOT NULL,
  `type_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `dateCalibrated` datetime NOT NULL,
  `dateValid` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_C3F4474DA76ED395` (`user_id`),
  KEY `IDX_C3F4474DA247991F` (`sensor_id`),
  KEY `IDX_C3F4474DC54C8C93` (`type_id`),
  CONSTRAINT `FK_C3F4474DA247991F` FOREIGN KEY (`sensor_id`) REFERENCES `sensor_sensor` (`id`),
  CONSTRAINT `FK_C3F4474DA76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_C3F4474DC54C8C93` FOREIGN KEY (`type_id`) REFERENCES `sensor_calibration_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_sensor_calibration`
--


--
-- Table structure for table `sensor_sensor_calibration_property`
--

CREATE TABLE `sensor_sensor_calibration_property` (
  `id` int NOT NULL AUTO_INCREMENT,
  `property_id` int NOT NULL,
  `calibration_id` int NOT NULL,
  `value` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `valueArray` longtext COLLATE utf8mb3_unicode_ci COMMENT '(DC2Type:array)',
  `valueInteger` int DEFAULT NULL,
  `valueDate` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_AEFA04CA549213EC` (`property_id`),
  KEY `IDX_AEFA04CA8DE210C5` (`calibration_id`),
  CONSTRAINT `FK_AEFA04CA549213EC` FOREIGN KEY (`property_id`) REFERENCES `sensor_property` (`id`),
  CONSTRAINT `FK_AEFA04CA8DE210C5` FOREIGN KEY (`calibration_id`) REFERENCES `sensor_sensor_calibration` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_sensor_calibration_property`
--


--
-- Table structure for table `sensor_sensor_changelog`
--

CREATE TABLE `sensor_sensor_changelog` (
  `id` int NOT NULL AUTO_INCREMENT,
  `sensor_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `message` longtext COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_EE444716A247991F` (`sensor_id`),
  KEY `IDX_EE444716A76ED395` (`user_id`),
  CONSTRAINT `FK_EE444716A247991F` FOREIGN KEY (`sensor_id`) REFERENCES `sensor_sensor` (`id`),
  CONSTRAINT `FK_EE444716A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_sensor_changelog`
--


--
-- Table structure for table `sensor_sensor_link`
--

CREATE TABLE `sensor_sensor_link` (
  `id` int NOT NULL AUTO_INCREMENT,
  `sensor_id` int NOT NULL,
  `type_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `url` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_F39D78C3A247991F` (`sensor_id`),
  KEY `IDX_F39D78C3C54C8C93` (`type_id`),
  CONSTRAINT `FK_F39D78C3A247991F` FOREIGN KEY (`sensor_id`) REFERENCES `sensor_sensor` (`id`),
  CONSTRAINT `FK_F39D78C3C54C8C93` FOREIGN KEY (`type_id`) REFERENCES `sensor_sensor_link_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_sensor_link`
--


--
-- Table structure for table `sensor_sensor_link_type`
--

CREATE TABLE `sensor_sensor_link_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_1B9FA497999517A` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_sensor_link_type`
--


--
-- Table structure for table `sensor_sensor_property`
--

CREATE TABLE `sensor_sensor_property` (
  `id` int NOT NULL AUTO_INCREMENT,
  `property_id` int NOT NULL,
  `sensor_id` int NOT NULL,
  `value` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `valueArray` longtext COLLATE utf8mb3_unicode_ci COMMENT '(DC2Type:array)',
  `valueInteger` int DEFAULT NULL,
  `valueDate` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_54A3A7EE549213EC` (`property_id`),
  KEY `IDX_54A3A7EEA247991F` (`sensor_id`),
  CONSTRAINT `FK_54A3A7EE549213EC` FOREIGN KEY (`property_id`) REFERENCES `sensor_property` (`id`),
  CONSTRAINT `FK_54A3A7EEA247991F` FOREIGN KEY (`sensor_id`) REFERENCES `sensor_sensor` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_sensor_property`
--


--
-- Table structure for table `sensor_sensor_status`
--

CREATE TABLE `sensor_sensor_status` (
  `id` int NOT NULL AUTO_INCREMENT,
  `sensor_id` int NOT NULL,
  `status_id` int NOT NULL,
  `user_id` int NOT NULL,
  `active` smallint NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `description` longtext COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_417D26B2A247991F` (`sensor_id`),
  KEY `IDX_417D26B26BF700BD` (`status_id`),
  KEY `IDX_417D26B2A76ED395` (`user_id`),
  CONSTRAINT `FK_417D26B26BF700BD` FOREIGN KEY (`status_id`) REFERENCES `sensor_status` (`id`),
  CONSTRAINT `FK_417D26B2A247991F` FOREIGN KEY (`sensor_id`) REFERENCES `sensor_sensor` (`id`),
  CONSTRAINT `FK_417D26B2A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_sensor_status`
--


--
-- Table structure for table `sensor_sensor_type`
--

CREATE TABLE `sensor_sensor_type` (
  `sensor_id` int NOT NULL,
  `type_id` int NOT NULL,
  PRIMARY KEY (`sensor_id`,`type_id`),
  KEY `IDX_49EFB61BA247991F` (`sensor_id`),
  KEY `IDX_49EFB61BC54C8C93` (`type_id`),
  CONSTRAINT `FK_49EFB61BA247991F` FOREIGN KEY (`sensor_id`) REFERENCES `sensor_sensor` (`id`),
  CONSTRAINT `FK_49EFB61BC54C8C93` FOREIGN KEY (`type_id`) REFERENCES `sensor_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_sensor_type`
--


--
-- Table structure for table `sensor_status`
--

CREATE TABLE `sensor_status` (
  `id` int NOT NULL AUTO_INCREMENT,
  `status` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `frontColor` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `backColor` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_status`
--


--
-- Table structure for table `sensor_type`
--

CREATE TABLE `sensor_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `color` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_A13AC6865E237E06` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_type`
--


--
-- Table structure for table `sensor_type_calibration_types`
--

CREATE TABLE `sensor_type_calibration_types` (
  `sensor_type_id` int NOT NULL,
  `calibration_type_id` int NOT NULL,
  PRIMARY KEY (`sensor_type_id`,`calibration_type_id`),
  KEY `IDX_85C90886D8550BD9` (`sensor_type_id`),
  KEY `IDX_85C9088646EE3276` (`calibration_type_id`),
  CONSTRAINT `FK_85C9088646EE3276` FOREIGN KEY (`calibration_type_id`) REFERENCES `sensor_calibration_type` (`id`),
  CONSTRAINT `FK_85C90886D8550BD9` FOREIGN KEY (`sensor_type_id`) REFERENCES `sensor_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_type_calibration_types`
--


--
-- Table structure for table `sensor_type_property`
--

CREATE TABLE `sensor_type_property` (
  `type_id` int NOT NULL,
  `property_id` int NOT NULL,
  PRIMARY KEY (`type_id`,`property_id`),
  KEY `IDX_D2E7569CC54C8C93` (`type_id`),
  KEY `IDX_D2E7569C549213EC` (`property_id`),
  CONSTRAINT `FK_D2E7569C549213EC` FOREIGN KEY (`property_id`) REFERENCES `sensor_property` (`id`),
  CONSTRAINT `FK_D2E7569CC54C8C93` FOREIGN KEY (`type_id`) REFERENCES `sensor_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_type_property`
--


--
-- Table structure for table `sensor_vendor`
--

CREATE TABLE `sensor_vendor` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `abbreviation` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_5BB51DE65E237E06` (`name`),
  UNIQUE KEY `UNIQ_5BB51DE6BCF3411D` (`abbreviation`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sensor_vendor`
--


--
-- Table structure for table `substrate_io`
--

CREATE TABLE `substrate_io` (
  `id` int NOT NULL AUTO_INCREMENT,
  `substrate_id` int NOT NULL,
  `user_id` int NOT NULL,
  `run_substrate_id` int DEFAULT NULL,
  `amount` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `reason` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_25754684B2A79F0C` (`substrate_id`),
  KEY `IDX_25754684A76ED395` (`user_id`),
  KEY `IDX_257546842168D886` (`run_substrate_id`),
  CONSTRAINT `FK_257546842168D886` FOREIGN KEY (`run_substrate_id`) REFERENCES `run_substrate` (`id`),
  CONSTRAINT `FK_25754684A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_25754684B2A79F0C` FOREIGN KEY (`substrate_id`) REFERENCES `substrate_substrate` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `substrate_io`
--


--
-- Table structure for table `substrate_property`
--

CREATE TABLE `substrate_property` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `property` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `label` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `showInList` smallint NOT NULL,
  `isBoxSize` smallint NOT NULL,
  `values` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `unit` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sort` smallint NOT NULL,
  `friendlyText` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `defaultValue` longtext COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_DDBDCA0A8BF21CDE` (`property`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `substrate_property`
--

INSERT INTO `substrate_property` VALUES (1,'radio','materialType','Material type',1,2,'Cz:Cz|Fz:Fz|Multi:Multi|Other:Other','',2,'Give the material type of the substrate',NULL),(2,'text','thickness','Thickness',1,2,'~200:~200|0.14:0.14|100:100|104:104|110:110|1100:1100|115:115|125:125|125-155:125-155|130:130|140:140|145:145|145-150:145-150|150 ± 20:150 ± 20|151-184:151-184|155:155|160:160|160 +/- 20:160 +/- 20|164-183:164-183|165:165|165-182:165-182|165-215:165-215|168:168|170:170|170 ± 20:170 ± 20|170-240:170-240|175:175|175-225:175-225|180:180|180 ± 20:180 ± 20|185:185|190:190|200:200|200 +/- 20:200 +/- 20|200 ± 20:200 ± 20|200 ± 30:200 ± 30|2000:2000|210±20:210±20|250:250|250-300:250-300|255-275:255-275|255-305:255-305|260 - 300:260 - 300|260-290:260-290|270-310:270-310|280:280|320:320|330:330|350:350|375:375|385 +/- 15:385 +/- 15|400:400|4000:4000|45:45|50:50|50-55:50-55|50-60:50-60|500:500|508+-35:508+-35|508±15:508±15|525:525|58:58|610-640:610-640|62:62|625:625|625+/-35:625+/-35|654:654|675:675|680:680|690-730:690-730|70-75:70-75|700:700|710-740:710-740|725:725|725 +/- 15:725 +/- 15|740:740|83:83|85:85|90-95:90-95|95:95|NA:NA|x:x','um',11,'Give the material type of the substrate',NULL),(3,'radio','shape','Shape',1,2,'Irregular:Irregular|Round:Round|semi-Square:semi-Square|Square:Square','',7,'Give the shape of the substrate',NULL);

--
-- Table structure for table `substrate_substrate`
--

CREATE TABLE `substrate_substrate` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `location_id` int DEFAULT NULL,
  `project_id` int DEFAULT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `information` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  `approvalRequired` smallint NOT NULL,
  `labelledStock` smallint NOT NULL,
  `stockManaged` smallint NOT NULL,
  `stockWarningLimit` smallint DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `type_id` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_291AA9D8EA750E8` (`label`),
  KEY `IDX_291AA9D8A76ED395` (`user_id`),
  KEY `IDX_291AA9D8166D1F9C` (`project_id`),
  KEY `IDX_291AA9D864D218E` (`location_id`),
  KEY `IDX_291AA9D8C54C8C93` (`type_id`),
  CONSTRAINT `FK_291AA9D8166D1F9C` FOREIGN KEY (`project_id`) REFERENCES `organisation_project` (`id`),
  CONSTRAINT `FK_291AA9D864D218E` FOREIGN KEY (`location_id`) REFERENCES `room_location` (`id`),
  CONSTRAINT `FK_291AA9D8A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_291AA9D8C54C8C93` FOREIGN KEY (`type_id`) REFERENCES `substrate_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `substrate_substrate`
--


--
-- Table structure for table `substrate_substrate_file`
--

CREATE TABLE `substrate_substrate_file` (
  `substrate_id` int NOT NULL,
  `file_id` int NOT NULL,
  PRIMARY KEY (`substrate_id`,`file_id`),
  KEY `IDX_DAB9D51B2A79F0C` (`substrate_id`),
  KEY `IDX_DAB9D5193CB796C` (`file_id`),
  CONSTRAINT `FK_DAB9D5193CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`),
  CONSTRAINT `FK_DAB9D51B2A79F0C` FOREIGN KEY (`substrate_id`) REFERENCES `substrate_substrate` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `substrate_substrate_file`
--


--
-- Table structure for table `substrate_substrate_property`
--

CREATE TABLE `substrate_substrate_property` (
  `id` int NOT NULL AUTO_INCREMENT,
  `property_id` int NOT NULL,
  `substrate_id` int NOT NULL,
  `value` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `valueArray` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci COMMENT '(DC2Type:array)',
  `valueInteger` int DEFAULT NULL,
  `valueDate` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_5CE2D146549213EC` (`property_id`),
  KEY `IDX_5CE2D146B2A79F0C` (`substrate_id`),
  CONSTRAINT `FK_5CE2D146549213EC` FOREIGN KEY (`property_id`) REFERENCES `substrate_property` (`id`),
  CONSTRAINT `FK_5CE2D146B2A79F0C` FOREIGN KEY (`substrate_id`) REFERENCES `substrate_substrate` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `substrate_substrate_property`
--


--
-- Table structure for table `substrate_type`
--

CREATE TABLE `substrate_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `color` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `substrateNumberPrefix` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_29B632C15E237E06` (`name`),
  UNIQUE KEY `UNIQ_29B632C1586126C8` (`substrateNumberPrefix`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `substrate_type`
--


--
-- Table structure for table `substrate_type_property`
--

CREATE TABLE `substrate_type_property` (
  `type_id` int NOT NULL,
  `property_id` int NOT NULL,
  PRIMARY KEY (`type_id`,`property_id`),
  KEY `IDX_AE6034D1C54C8C93` (`type_id`),
  KEY `IDX_AE6034D1549213EC` (`property_id`),
  CONSTRAINT `FK_AE6034D1549213EC` FOREIGN KEY (`property_id`) REFERENCES `substrate_property` (`id`),
  CONSTRAINT `FK_AE6034D1C54C8C93` FOREIGN KEY (`type_id`) REFERENCES `substrate_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `substrate_type_property`
--


--
-- Table structure for table `template_changelog`
--

CREATE TABLE `template_changelog` (
  `id` int NOT NULL AUTO_INCREMENT,
  `template_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `message` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_11150B75DA0FB8` (`template_id`),
  KEY `IDX_11150B7A76ED395` (`user_id`),
  CONSTRAINT `FK_11150B75DA0FB8` FOREIGN KEY (`template_id`) REFERENCES `template_template` (`id`),
  CONSTRAINT `FK_11150B7A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_changelog`
--


--
-- Table structure for table `template_measurement`
--

CREATE TABLE `template_measurement` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `sequence` int NOT NULL,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `definition` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `method` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `resultType` smallint NOT NULL,
  `requirement_id` int DEFAULT NULL,
  `loggingParameter_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_2719CC7573B21E9C` (`step_id`),
  UNIQUE KEY `UNIQ_2719CC757B576F77` (`requirement_id`),
  KEY `IDX_2719CC75C80EE3D9` (`loggingParameter_id`),
  CONSTRAINT `FK_2719CC7573B21E9C` FOREIGN KEY (`step_id`) REFERENCES `template_step` (`id`),
  CONSTRAINT `FK_2719CC757B576F77` FOREIGN KEY (`requirement_id`) REFERENCES `template_requirement` (`id`),
  CONSTRAINT `FK_2719CC75C80EE3D9` FOREIGN KEY (`loggingParameter_id`) REFERENCES `equipment_logging_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_measurement`
--


--
-- Table structure for table `template_measurement_label`
--

CREATE TABLE `template_measurement_label` (
  `id` int NOT NULL AUTO_INCREMENT,
  `measurement_id` int NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `open` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_E3866DAC924EA134` (`measurement_id`),
  CONSTRAINT `FK_E3866DAC924EA134` FOREIGN KEY (`measurement_id`) REFERENCES `template_measurement` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_measurement_label`
--


--
-- Table structure for table `template_release`
--

CREATE TABLE `template_release` (
  `id` int NOT NULL AUTO_INCREMENT,
  `template_id` int NOT NULL,
  `user_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `version` int NOT NULL,
  `notes` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_CDFF78245DA0FB8` (`template_id`),
  KEY `IDX_CDFF7824A76ED395` (`user_id`),
  CONSTRAINT `FK_CDFF78245DA0FB8` FOREIGN KEY (`template_id`) REFERENCES `template_template` (`id`),
  CONSTRAINT `FK_CDFF7824A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_release`
--


--
-- Table structure for table `template_requirement`
--

CREATE TABLE `template_requirement` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `requirement_step_id` int DEFAULT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `sequence` int NOT NULL,
  `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `definition` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `method` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `minValue` double DEFAULT NULL,
  `maxValue` double DEFAULT NULL,
  `target` double DEFAULT NULL,
  `inclusive` smallint NOT NULL,
  `unit` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `loggingParameter_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_D0C6413473B21E9C` (`step_id`),
  KEY `IDX_D0C6413428383107` (`requirement_step_id`),
  KEY `IDX_D0C64134C80EE3D9` (`loggingParameter_id`),
  CONSTRAINT `FK_D0C6413428383107` FOREIGN KEY (`requirement_step_id`) REFERENCES `template_step` (`id`),
  CONSTRAINT `FK_D0C6413473B21E9C` FOREIGN KEY (`step_id`) REFERENCES `template_step` (`id`),
  CONSTRAINT `FK_D0C64134C80EE3D9` FOREIGN KEY (`loggingParameter_id`) REFERENCES `equipment_logging_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_requirement`
--


--
-- Table structure for table `template_requirement_label`
--

CREATE TABLE `template_requirement_label` (
  `id` int NOT NULL AUTO_INCREMENT,
  `requirement_id` int NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `open` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_A0480CDC7B576F77` (`requirement_id`),
  CONSTRAINT `FK_A0480CDC7B576F77` FOREIGN KEY (`requirement_id`) REFERENCES `template_requirement` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_requirement_label`
--


--
-- Table structure for table `template_role`
--

CREATE TABLE `template_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `order` int NOT NULL,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_role`
--


--
-- Table structure for table `template_step`
--

CREATE TABLE `template_step` (
  `id` int NOT NULL AUTO_INCREMENT,
  `template_id` int NOT NULL,
  `user_id` int NOT NULL,
  `processmodule_id` int NOT NULL,
  `stepgroup_id` int DEFAULT NULL,
  `process_module_recipe_version_id` int DEFAULT NULL,
  `number` int DEFAULT NULL,
  `sequence` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `time` time DEFAULT NULL,
  `processName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `private` smallint NOT NULL,
  `version` int NOT NULL,
  `subSteps` int NOT NULL,
  `standard` smallint NOT NULL,
  `remark` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `instructions` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `monitor_step_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_9677D4515DA0FB8` (`template_id`),
  KEY `IDX_9677D451A76ED395` (`user_id`),
  KEY `IDX_9677D45177F3AE70` (`processmodule_id`),
  KEY `IDX_9677D4513AE1BED5` (`stepgroup_id`),
  KEY `IDX_9677D451540BA1EB` (`process_module_recipe_version_id`),
  KEY `IDX_9677D45120DE3AF7` (`monitor_step_id`),
  CONSTRAINT `FK_9677D45120DE3AF7` FOREIGN KEY (`monitor_step_id`) REFERENCES `equipment_monitor_step` (`id`),
  CONSTRAINT `FK_9677D4513AE1BED5` FOREIGN KEY (`stepgroup_id`) REFERENCES `template_step_group` (`id`),
  CONSTRAINT `FK_9677D451540BA1EB` FOREIGN KEY (`process_module_recipe_version_id`) REFERENCES `process_module_recipe_version` (`id`),
  CONSTRAINT `FK_9677D4515DA0FB8` FOREIGN KEY (`template_id`) REFERENCES `template_template` (`id`),
  CONSTRAINT `FK_9677D45177F3AE70` FOREIGN KEY (`processmodule_id`) REFERENCES `process_module` (`id`),
  CONSTRAINT `FK_9677D451A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_step`
--


--
-- Table structure for table `template_step_file`
--

CREATE TABLE `template_step_file` (
  `step_id` int NOT NULL,
  `file_id` int NOT NULL,
  PRIMARY KEY (`step_id`,`file_id`),
  KEY `IDX_B5ADDF773B21E9C` (`step_id`),
  KEY `IDX_B5ADDF793CB796C` (`file_id`),
  CONSTRAINT `FK_B5ADDF773B21E9C` FOREIGN KEY (`step_id`) REFERENCES `template_step` (`id`),
  CONSTRAINT `FK_B5ADDF793CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_step_file`
--


--
-- Table structure for table `template_step_group`
--

CREATE TABLE `template_step_group` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `locked` smallint NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_step_group`
--


--
-- Table structure for table `template_step_label`
--

CREATE TABLE `template_step_label` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `open` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_304EE2D873B21E9C` (`step_id`),
  CONSTRAINT `FK_304EE2D873B21E9C` FOREIGN KEY (`step_id`) REFERENCES `template_step` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_step_label`
--


--
-- Table structure for table `template_step_parameter`
--

CREATE TABLE `template_step_parameter` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_id` int NOT NULL,
  `parameter_id` int NOT NULL,
  `unit_id` int DEFAULT NULL,
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `version` int NOT NULL,
  `sequence` int NOT NULL,
  `showInName` smallint NOT NULL,
  `required` smallint NOT NULL,
  `header` smallint NOT NULL,
  `locked` smallint NOT NULL,
  `visibility` smallint NOT NULL,
  `fixRange` smallint NOT NULL,
  `minValue` double DEFAULT NULL,
  `maxValue` double DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_52BB16C173B21E9C` (`step_id`),
  KEY `IDX_52BB16C17C56DBD6` (`parameter_id`),
  KEY `IDX_52BB16C1F8BD700D` (`unit_id`),
  CONSTRAINT `FK_52BB16C173B21E9C` FOREIGN KEY (`step_id`) REFERENCES `template_step` (`id`),
  CONSTRAINT `FK_52BB16C17C56DBD6` FOREIGN KEY (`parameter_id`) REFERENCES `process_parameter` (`id`),
  CONSTRAINT `FK_52BB16C1F8BD700D` FOREIGN KEY (`unit_id`) REFERENCES `process_unit` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_step_parameter`
--


--
-- Table structure for table `template_step_parameter_value`
--

CREATE TABLE `template_step_parameter_value` (
  `id` int NOT NULL AUTO_INCREMENT,
  `step_parameter_id` int NOT NULL,
  `value` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sequence` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_71028DE47392C04` (`step_parameter_id`),
  CONSTRAINT `FK_71028DE47392C04` FOREIGN KEY (`step_parameter_id`) REFERENCES `template_step_parameter` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_step_parameter_value`
--


--
-- Table structure for table `template_step_tag`
--

CREATE TABLE `template_step_tag` (
  `step_id` int NOT NULL,
  `tag_id` int NOT NULL,
  PRIMARY KEY (`step_id`,`tag_id`),
  KEY `IDX_CEC1821273B21E9C` (`step_id`),
  KEY `IDX_CEC18212BAD26311` (`tag_id`),
  CONSTRAINT `FK_CEC1821273B21E9C` FOREIGN KEY (`step_id`) REFERENCES `template_step` (`id`),
  CONSTRAINT `FK_CEC18212BAD26311` FOREIGN KEY (`tag_id`) REFERENCES `organisation_project_tag` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_step_tag`
--


--
-- Table structure for table `template_template`
--

CREATE TABLE `template_template` (
  `id` int NOT NULL AUTO_INCREMENT,
  `project_id` int DEFAULT NULL,
  `user_id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `status` smallint NOT NULL,
  `standard` smallint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_C8362FF05E237E06` (`name`),
  KEY `IDX_C8362FF0166D1F9C` (`project_id`),
  KEY `IDX_C8362FF0A76ED395` (`user_id`),
  CONSTRAINT `FK_C8362FF0166D1F9C` FOREIGN KEY (`project_id`) REFERENCES `organisation_project` (`id`),
  CONSTRAINT `FK_C8362FF0A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_template`
--


--
-- Table structure for table `template_template_file`
--

CREATE TABLE `template_template_file` (
  `template_id` int NOT NULL,
  `file_id` int NOT NULL,
  PRIMARY KEY (`template_id`,`file_id`),
  KEY `IDX_421A6D5A5DA0FB8` (`template_id`),
  KEY `IDX_421A6D5A93CB796C` (`file_id`),
  CONSTRAINT `FK_421A6D5A5DA0FB8` FOREIGN KEY (`template_id`) REFERENCES `template_template` (`id`),
  CONSTRAINT `FK_421A6D5A93CB796C` FOREIGN KEY (`file_id`) REFERENCES `file_file` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_template_file`
--


--
-- Table structure for table `template_template_role`
--

CREATE TABLE `template_template_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `template_id` int NOT NULL,
  `user_id` int NOT NULL,
  `role_id` int NOT NULL,
  `dateCreated` datetime NOT NULL,
  `comment` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `status` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_99ECD1205DA0FB8` (`template_id`),
  KEY `IDX_99ECD120A76ED395` (`user_id`),
  KEY `IDX_99ECD120D60322AC` (`role_id`),
  CONSTRAINT `FK_99ECD1205DA0FB8` FOREIGN KEY (`template_id`) REFERENCES `template_template` (`id`),
  CONSTRAINT `FK_99ECD120A76ED395` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`id`),
  CONSTRAINT `FK_99ECD120D60322AC` FOREIGN KEY (`role_id`) REFERENCES `template_role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_template_role`
--


--
-- Table structure for table `template_template_variable`
--

CREATE TABLE `template_template_variable` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8mb3_unicode_ci NOT NULL,
  `dateCreated` datetime NOT NULL,
  `lastUpdate` datetime DEFAULT NULL,
  `stepParameterValue_id` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_62257D3C569A494C` (`stepParameterValue_id`),
  CONSTRAINT `FK_62257D3C569A494C` FOREIGN KEY (`stepParameterValue_id`) REFERENCES `template_step_parameter_value` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_template_variable`
--



