--
-- Host: localhost    Database: blueco_fleet_manager
-- ------------------------------------------------------


--
-- Table structure for table `ship_config`
--

CREATE TABLE `ship_config` (
  `ship_id` int(10) unsigned NOT NULL,
  `config_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`ship_id`,`config_key`),
  CONSTRAINT `ship_config_ibfk_1` FOREIGN KEY (`ship_id`) REFERENCES `ship` (`ship_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `ship_config`
--

INSERT INTO `ship_config` VALUES (1,'FLOWMETER_TYPE','blueco'),(1,'GPS_TYPE','GPRMC'),(1,'OBM_ENGINE_SOURCE','sensor'),(2,'FLOWMETER_TYPE','external'),(2,'GPS_TYPE','GPRMC'),(2,'OBM_ENGINE_SOURCE','sensor'),(4,'FLOWMETER_TYPE','blueco'),(4,'GPS_TYPE','GPRMC'),(4,'OBM_ENGINE_SOURCE','sensor'),(5,'FLOWMETER_TYPE','blueco'),(5,'GPS_TYPE','GPGGA'),(5,'OBM_ENGINE_SOURCE','sensor'),(6,'FLOWMETER_TYPE','blueco'),(6,'GPS_TYPE','GPRMC'),(6,'OBM_ENGINE_SOURCE','sensor'),(7,'FLOWMETER_TYPE','blueco'),(7,'GPS_TYPE','GPRMC'),(7,'OBM_ENGINE_SOURCE','sensor'),(8,'FLOWMETER_TYPE','blueco'),(8,'GPS_TYPE','GPRMC'),(8,'OBM_ENGINE_SOURCE','engine'),(9,'FLOWMETER_TYPE','blueco'),(9,'GPS_TYPE','GPRMC'),(9,'OBM_ENGINE_SOURCE','sensor'),(10,'FLOWMETER_TYPE','blueco'),(10,'GPS_TYPE','GPRMC'),(10,'OBM_ENGINE_SOURCE','sensor'),(11,'FLOWMETER_TYPE','blueco'),(11,'GPS_TYPE','GPRMC'),(11,'OBM_ENGINE_SOURCE','sensor'),(12,'FLOWMETER_TYPE','blueco'),(12,'GPS_TYPE','GPRMC'),(12,'OBM_ENGINE_SOURCE','engine'),(13,'FLOWMETER_TYPE','blueco'),(13,'GPS_TYPE','GPRMC'),(13,'OBM_ENGINE_SOURCE','engine'),(14,'FLOWMETER_TYPE','blueco'),(14,'GPS_TYPE','GPRMC'),(14,'OBM_ENGINE_SOURCE','sensor'),(15,'FLOWMETER_TYPE','blueco'),(15,'GPS_TYPE','GPRMC'),(15,'OBM_ENGINE_SOURCE','sensor'),(16,'FLOWMETER_TYPE','blueco'),(16,'GPS_TYPE','GPRMC'),(16,'OBM_ENGINE_SOURCE','sensor'),(17,'FLOWMETER_TYPE','engine'),(17,'GPS_TYPE','GPGGA'),(17,'OBM_ENGINE_SOURCE','engine'),(18,'FLOWMETER_TYPE','engine'),(18,'GPS_TYPE','GPRMC'),(18,'OBM_ENGINE_SOURCE','engine'),(19,'FLOWMETER_TYPE','blueco'),(19,'GPS_TYPE','GPRMC'),(19,'OBM_ENGINE_SOURCE','engine'),(20,'FLOWMETER_TYPE','blueco'),(20,'GPS_TYPE','GPRMC'),(20,'OBM_ENGINE_SOURCE','sensor'),(21,'FLOWMETER_TYPE','external'),(21,'GPS_TYPE','GPRMC'),(21,'OBM_ENGINE_SOURCE','sensor'),(22,'FLOWMETER_TYPE','blueco'),(22,'GPS_TYPE','GPRMC'),(22,'OBM_ENGINE_SOURCE','sensor'),(23,'FLOWMETER_TYPE','blueco'),(23,'GPS_TYPE','GPRMC'),(23,'OBM_ENGINE_SOURCE','engine'),(24,'FLOWMETER_TYPE','blueco'),(24,'GPS_TYPE','GPRMC'),(24,'OBM_ENGINE_SOURCE','engine'),(25,'FLOWMETER_TYPE','blueco'),(25,'GPS_TYPE','GPRMC'),(25,'OBM_ENGINE_SOURCE','engine'),(26,'FLOWMETER_TYPE','engine'),(26,'GPS_TYPE','GPRMC'),(26,'OBM_ENGINE_SOURCE','engine'),(27,'FLOWMETER_TYPE','blueco'),(27,'GPS_TYPE','GPRMC'),(27,'OBM_ENGINE_SOURCE','sensor'),(28,'FLOWMETER_TYPE','blueco'),(28,'GPS_TYPE','GPRMC'),(28,'OBM_ENGINE_SOURCE','sensor'),(29,'FLOWMETER_TYPE','blueco'),(29,'GPS_TYPE','GPRMC'),(29,'OBM_ENGINE_SOURCE','sensor'),(30,'FLOWMETER_TYPE','engine'),(30,'GPS_TYPE','GPRMC'),(30,'OBM_ENGINE_SOURCE','engine'),(31,'FLOWMETER_TYPE','blueco'),(31,'GPS_TYPE','GPRMC'),(31,'OBM_ENGINE_SOURCE','engine'),(32,'FLOWMETER_TYPE','blueco'),(32,'GPS_TYPE','GPRMC'),(32,'OBM_ENGINE_SOURCE','sensor'),(33,'FLOWMETER_TYPE','blueco'),(33,'GPS_TYPE','GPRMC'),(33,'OBM_ENGINE_SOURCE','engine'),(34,'FLOWMETER_TYPE','engine'),(34,'GPS_TYPE','GPRMC'),(34,'OBM_ENGINE_SOURCE','engine');

--
-- Table structure for table `ship_note`
--

CREATE TABLE `ship_note` (
  `trip_note_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `content` text COLLATE utf8_unicode_ci,
  `insert_date` datetime DEFAULT NULL,
  `ship_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`trip_note_id`),
  KEY `fk_trip_note_ship1_idx` (`ship_id`),
  KEY `insert_date_idx` (`insert_date`),
  KEY `insert_date_ship_idx` (`insert_date`,`ship_id`),
  CONSTRAINT `fk_trip_note_ship1` FOREIGN KEY (`ship_id`) REFERENCES `ship` (`ship_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=61 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `ship_note`
--

INSERT INTO `ship_note` VALUES (1,'Test 1','2016-01-21 12:17:59',1),(2,'Test 2','2016-01-21 12:18:10',1),(3,'Test 3','2016-01-21 15:19:27',1),(4,'Test 4','2016-01-21 15:26:29',1),(5,'STILGELEGEN VAN 22:00 TOT 06:30 UUR.','2016-03-05 07:36:07',1),(6,'tik in motor','2016-03-25 11:19:47',7),(7,'test','2016-06-08 19:22:08',10),(8,'Eerste echte proeftrip','2016-06-30 13:58:52',4),(9,'Doet ´t niet','2016-07-02 13:08:22',4),(10,'Router doet ´t wel.<br>Kastje met hard en software kan ik niet in kijken. <br>Flowmeter led flits keurig elke seconde op 900 toeren met nu geladen schip. Dus waarschijnlijk een software matig probleem.','2016-07-02 13:22:15',4),(11,'Geen wijziging in foutive weergave verbruik','2016-07-03 05:58:56',4),(12,'GPS werkt ook niet, zowel positie als snelheid','2016-07-03 06:21:55',4),(13,'Vol aan op de D\'Kil. Geen uitlezing. Led op de Florwmeter doetl het keurig, nu 1 flash per 1/2 seconde, regelmatig.','2016-07-03 10:10:08',4),(14,'Opstarten nieuwe triep geeft ook geen resultaat.<br>','2016-07-03 10:14:34',4),(15,'de hele zaak moet gereset worden, maar hoe?','2016-07-03 13:22:00',4),(16,'Tour gestartet in Duisburg Km 784<br>Pegel Oestrich: 223','2016-07-13 16:59:04',2),(17,'Pegel Oestrich:  273','2016-07-16 06:12:01',2),(18,'Pegel Oestrich:  267 (-10)','2016-07-19 12:03:20',2),(19,'Pegel Oestrich: 267 ( -10 )<br>','2016-07-19 12:06:20',2),(20,'Pegel Oestrich: 254 ( -13 )','2016-07-20 12:08:43',2),(21,'Pegel Oestrich: 242 ( -12 )','2016-07-21 07:17:46',2),(22,'Pegel Oestrich: 242 ( -12 )','2016-07-21 07:17:56',2),(23,'Pegel Oestrich: 242 ( -12 )','2016-07-21 07:17:56',2),(24,'Pegel Oestrich: 242 ( -12 )','2016-07-21 07:17:57',2),(25,'Pegel Oestrich: 242 ( -12 )','2016-07-21 07:17:58',2),(26,'Pegel Oestrich : 243 (  1 )','2016-07-22 07:14:33',2),(27,'Pegel Oestrich: 233 (-10 )','2016-07-23 07:03:09',2),(28,'Pegel Oestrich : 246 (  13 )','2016-07-24 06:00:14',2),(29,'De Rpm zijn weer dol','2016-09-22 13:20:47',15),(30,'nix gut','2016-10-02 16:35:27',2),(31,'bij deze reis is het schip gelijk lastig geladen.<br>het stuurd moeilijk en het loopt slechter.<br>bij andere reizen laden we 10 cm voor over en dan loopt het schip beter weg dus meer snelheid','2016-11-30 07:21:04',10),(32,'met vloed mee dus voor stroom half geladen','2016-12-13 13:40:08',10),(33,'30-12-2016 Stuurboord motor geeft dubbele brandstof verbruik aan.<br>Omgevingsdruk staat altijd op 1013 HPA','2016-12-30 07:37:19',15),(34,'Trip   1       Wdam           Doel','2017-01-25 15:31:36',21),(35,'2017     2','2017-01-26 09:01:00',21),(36,'5    R Dam         Ravenswaaij','2017-02-02 05:48:00',21),(37,'Ravenswaaij           Heerewaarden','2017-02-02 08:47:35',21),(38,'6   2017    heerewaarden        Rdam','2017-02-02 14:03:19',21),(39,'Reis 7     Rdam    Doel    Leeg','2017-02-06 11:22:43',21),(40,'reis  8  Hedel  Heerew     Schravendeel','2017-02-07 12:32:56',21),(41,'2<br>','2017-02-27 15:40:13',11),(42,'diepte 7 meter','2017-02-28 04:36:02',11),(43,'diepte 6 meter<br>','2017-02-28 04:46:27',11),(44,'1620 max','2017-02-28 05:22:33',11),(45,'2 meter diep','2017-02-28 07:47:50',11),(46,'4 meter diepte','2017-02-28 08:11:50',11),(47,'diepte 2.50 meter','2017-02-28 08:22:55',11),(48,'diepte 2 meter','2017-02-28 08:29:22',11),(49,'1604 max','2017-02-28 08:33:10',11),(50,'met andere branstof gaan varen','2017-04-07 11:10:18',10),(51,'Op 09-04-2017 2773 ton containers bij geladen','2017-04-09 14:03:32',19),(52,'tonnen vergeten : tot liht oyen  was het 474','2017-04-12 09:12:42',10),(53,'geht nicht','2017-06-07 16:52:14',2),(54,'geht immer noch nicht','2017-06-07 16:52:39',2),(55,'leeg afvarig van de werf te heusden naar zwijndrecht om te bunkeren, aansluiten naar de geulhaven','2017-09-05 13:27:36',30),(56,'bij mpd de haven in voor ene korte instelling','2017-09-05 15:55:23',30),(57,'Neue Reise - Bergfahrt     Rotterdam-Worms   <br>Beladen mit 1300Ton        Tiefgang 208cm','2017-09-06 18:54:13',30),(58,'reise Rotterdam - Marl    mit   2000 Ton','2017-10-04 12:43:11',30),(59,'Reise Rotterdam - Frankfurt a/Main<br>mit 1500Ton','2017-10-07 18:42:01',30),(60,'uit val gehed','2017-11-16 14:56:56',10);

--
-- Table structure for table `ship_obm`
--

CREATE TABLE `ship_obm` (
  `ship_id` int(10) unsigned NOT NULL,
  `obm_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`ship_id`,`obm_id`),
  KEY `fk_ship_module_module1_idx` (`obm_id`),
  KEY `fk_ship_module_ship1_idx` (`ship_id`),
  CONSTRAINT `fk_ship_module_module1` FOREIGN KEY (`obm_id`) REFERENCES `obm` (`obm_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_ship_module_ship1` FOREIGN KEY (`ship_id`) REFERENCES `ship` (`ship_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `ship_obm`
--

INSERT INTO `ship_obm` VALUES (1,1),(2,1),(4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10,1),(11,1),(12,1),(13,1),(14,1),(15,1),(16,1),(17,1),(18,1),(19,1),(20,1),(21,1),(22,1),(23,1),(24,1),(25,1),(26,1),(28,1),(29,1),(30,1),(31,1),(32,1),(33,1),(2,2),(4,2),(5,2),(8,2),(9,2),(10,2),(11,2),(12,2),(13,2),(14,2),(15,2),(17,2),(18,2),(19,2),(20,2),(21,2),(22,2),(23,2),(24,2),(25,2),(26,2),(28,2),(29,2),(30,2),(31,2),(32,2),(33,2),(34,2),(4,3),(5,3),(8,3),(10,3),(11,3),(12,3),(13,3),(14,3),(15,3),(17,3),(18,3),(19,3),(20,3),(21,3),(22,3),(25,3),(27,3),(29,3),(30,3),(31,3),(32,3),(33,3);

--
-- Table structure for table `ship_user`
--

CREATE TABLE `ship_user` (
  `ship_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  KEY `ship_id` (`ship_id`,`user_id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `ship_user_ibfk_1` FOREIGN KEY (`ship_id`) REFERENCES `ship` (`ship_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ship_user_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `ship_user`
--

INSERT INTO `ship_user` VALUES (2,13),(2,35),(2,36),(4,48),(4,49),(8,25),(10,10),(10,12),(12,32),(13,32),(19,55),(23,40),(24,40),(25,44),(30,52),(30,53),(30,54);


