CREATE DATABASE  IF NOT EXISTS `petfeeder_db` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `petfeeder_db`;
--
-- Host: localhost    Database: petfeeder_db
-- ------------------------------------------------------


--
-- Table structure for table `tbldog`
--

CREATE TABLE `tbldog` (
  `dog_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(80) DEFAULT NULL,
  `weight_in_grams` int(10) unsigned zerofill DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  PRIMARY KEY (`dog_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbldog`
--

INSERT INTO `tbldog` VALUES (1,'Pepper',0000005623,'2010-05-01'),(2,'Gelato',0000006384,'2011-09-15');

--
-- Table structure for table `tbldrinklog`
--

CREATE TABLE `tbldrinklog` (
  `drink_id` int(11) NOT NULL AUTO_INCREMENT,
  `millilitres_left` int(11) DEFAULT NULL,
  `timestamp` datetime DEFAULT NULL,
  `dog_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`drink_id`,`dog_id`),
  KEY `fk_tbldrinklog_tbldog1_idx` (`dog_id`),
  CONSTRAINT `fk_tbldrinklog_tbldog1` FOREIGN KEY (`dog_id`) REFERENCES `tbldog` (`dog_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbldrinklog`
--

INSERT INTO `tbldrinklog` VALUES (3,4500,'2017-05-01 07:03:00',1),(4,4234,'2017-05-01 07:03:44',1),(5,500,'2017-06-12 16:14:50',1),(6,4100,'2017-06-12 16:16:33',1),(7,4100,'2017-06-13 09:51:34',1),(8,4100,'2017-06-13 09:52:14',1),(9,4100,'2017-06-13 09:53:47',1),(10,4100,'2017-06-13 09:56:07',1),(11,4100,'2017-06-13 09:56:20',1),(12,5000,'2017-06-16 12:00:00',1),(13,4822,'2017-06-16 13:44:07',1),(14,3399,'2017-06-16 14:01:43',1),(15,529,'2017-06-17 07:03:01',1),(16,537,'2017-06-17 07:03:25',1),(17,533,'2017-06-17 07:03:57',1),(18,570,'2017-06-17 09:24:20',1),(19,635,'2017-06-17 09:24:32',1),(20,364,'2017-06-17 09:24:38',1),(21,625,'2017-06-17 09:24:49',1),(22,611,'2017-06-17 09:25:22',1),(23,380,'2017-06-17 09:25:34',1),(24,379,'2017-06-17 09:25:46',1),(25,375,'2017-06-17 09:25:52',1),(26,561,'2017-06-17 09:26:00',1),(27,372,'2017-06-17 09:26:05',1),(28,0,'2017-06-17 09:21:13',1),(29,0,'2017-06-17 09:21:40',1),(30,0,'2017-06-17 09:22:01',1),(31,0,'2017-06-17 09:22:34',1),(32,0,'2017-06-17 09:23:18',1),(33,0,'2017-06-17 09:23:41',1),(34,0,'2017-06-17 09:24:46',1),(35,0,'2017-06-17 09:24:58',1),(36,0,'2017-06-17 09:25:11',1),(37,0,'2017-06-17 09:25:53',1),(38,0,'2017-06-17 09:26:04',1),(39,0,'2017-06-17 09:26:34',1),(40,0,'2017-06-17 09:26:52',1),(41,0,'2017-06-17 09:42:43',1),(42,0,'2017-06-17 09:42:53',1),(43,5343,'2017-06-19 12:46:27',1),(44,430,'2017-06-19 12:46:31',1),(45,400,'2017-06-19 12:46:43',1),(46,342,'2017-06-19 12:47:02',1),(47,254,'2017-06-19 12:47:18',1),(48,324,'2017-06-19 12:47:38',1),(49,286,'2017-06-19 12:47:42',1),(50,335,'2017-06-19 12:48:40',1),(51,574,'2017-06-19 12:49:15',1),(52,291,'2017-06-19 12:49:37',1),(53,301,'2017-06-19 12:49:55',1),(54,373,'2017-06-19 12:50:14',1),(55,307,'2017-06-19 12:52:11',1);

--
-- Table structure for table `tblfoodlog`
--

CREATE TABLE `tblfoodlog` (
  `food_id` int(11) NOT NULL AUTO_INCREMENT,
  `grams_left` int(10) DEFAULT NULL,
  `timestamp` datetime DEFAULT NULL,
  `dog_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`food_id`,`dog_id`),
  UNIQUE KEY `food_id_UNIQUE` (`food_id`),
  KEY `fk_tblfoodlog_tbldog_idx` (`dog_id`),
  CONSTRAINT `fk_tblfoodlog_tbldog` FOREIGN KEY (`dog_id`) REFERENCES `tbldog` (`dog_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=203 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tblfoodlog`
--

INSERT INTO `tblfoodlog` VALUES (1,53,'2017-05-01 07:03:00',1),(2,52,'2017-06-16 07:00:00',1),(3,40,'2017-06-16 07:55:00',1),(4,30,'2017-06-16 12:00:00',1),(5,-5,'2017-06-17 07:36:33',1),(6,-5,'2017-06-17 07:36:34',1),(7,-5,'2017-06-17 07:36:34',1),(8,-5,'2017-06-17 07:36:34',1),(9,-5,'2017-06-17 07:36:35',1),(10,-5,'2017-06-17 07:36:35',1),(11,-5,'2017-06-17 07:36:36',1),(12,-5,'2017-06-17 07:36:36',1),(13,-5,'2017-06-17 07:36:37',1),(14,-5,'2017-06-17 07:36:37',1),(15,-5,'2017-06-17 07:36:38',1),(16,-5,'2017-06-17 07:36:38',1),(17,-5,'2017-06-17 07:36:39',1),(18,-5,'2017-06-17 07:36:39',1),(19,-5,'2017-06-17 07:36:39',1),(20,-5,'2017-06-17 07:36:40',1),(21,-5,'2017-06-17 07:36:40',1),(22,-5,'2017-06-17 07:36:41',1),(23,-5,'2017-06-17 07:36:41',1),(24,-5,'2017-06-17 07:36:42',1),(25,-5,'2017-06-17 07:36:42',1),(26,-5,'2017-06-17 07:36:43',1),(27,-5,'2017-06-17 07:36:43',1),(28,-5,'2017-06-17 07:36:43',1),(29,0,'2017-06-17 07:44:29',1),(30,0,'2017-06-17 07:44:29',1),(31,0,'2017-06-17 07:44:30',1),(32,0,'2017-06-17 07:44:30',1),(33,0,'2017-06-17 07:44:30',1),(34,0,'2017-06-17 07:44:31',1),(35,0,'2017-06-17 07:44:31',1),(36,0,'2017-06-17 07:44:32',1),(37,0,'2017-06-17 07:44:32',1),(38,0,'2017-06-17 07:44:33',1),(39,0,'2017-06-17 07:44:33',1),(40,0,'2017-06-17 07:44:34',1),(41,0,'2017-06-17 07:44:34',1),(42,0,'2017-06-17 07:44:34',1),(43,0,'2017-06-17 07:44:55',1),(44,-76,'2017-06-17 07:44:56',1),(45,-79,'2017-06-17 07:44:56',1),(46,-79,'2017-06-17 07:44:57',1),(47,-79,'2017-06-17 07:44:57',1),(48,-79,'2017-06-17 07:44:57',1),(49,-79,'2017-06-17 07:44:58',1),(50,-79,'2017-06-17 07:44:58',1),(51,-79,'2017-06-17 07:45:08',1),(52,-79,'2017-06-17 07:45:09',1),(53,-79,'2017-06-17 07:45:09',1),(54,-79,'2017-06-17 07:45:10',1),(55,-79,'2017-06-17 07:45:10',1),(56,-79,'2017-06-17 07:45:10',1),(57,-79,'2017-06-17 07:45:11',1),(58,-79,'2017-06-17 07:45:12',1),(59,-79,'2017-06-17 07:45:12',1),(60,-79,'2017-06-17 07:45:13',1),(61,-79,'2017-06-17 07:45:13',1),(62,-79,'2017-06-17 07:45:14',1),(63,-79,'2017-06-17 07:45:15',1),(64,-79,'2017-06-17 07:45:16',1),(65,-79,'2017-06-17 07:45:16',1),(66,-79,'2017-06-17 07:45:17',1),(67,-79,'2017-06-17 07:45:17',1),(68,-79,'2017-06-17 07:45:18',1),(69,-79,'2017-06-17 07:45:18',1),(70,-79,'2017-06-17 07:45:19',1),(71,-5,'2017-06-17 07:45:20',1),(72,-79,'2017-06-17 07:45:21',1),(73,-79,'2017-06-17 07:45:21',1),(74,-79,'2017-06-17 07:45:31',1),(75,-80,'2017-06-17 07:45:32',1),(76,-79,'2017-06-17 07:45:32',1),(77,-79,'2017-06-17 07:45:33',1),(78,-79,'2017-06-17 07:45:33',1),(79,-79,'2017-06-17 07:45:34',1),(80,-79,'2017-06-17 07:45:34',1),(81,-79,'2017-06-17 07:45:34',1),(82,-79,'2017-06-17 07:45:35',1),(83,-79,'2017-06-17 07:45:35',1),(84,-79,'2017-06-17 07:45:36',1),(85,-79,'2017-06-17 07:45:36',1),(86,-79,'2017-06-17 07:45:37',1),(87,-79,'2017-06-17 07:45:37',1),(88,-79,'2017-06-17 07:45:38',1),(89,-79,'2017-06-17 07:45:38',1),(90,-79,'2017-06-17 07:45:38',1),(91,-79,'2017-06-17 07:45:41',1),(92,-79,'2017-06-17 07:45:41',1),(93,-79,'2017-06-17 07:45:42',1),(94,-79,'2017-06-17 07:45:43',1),(95,-79,'2017-06-17 07:45:44',1),(96,-79,'2017-06-17 07:45:44',1),(97,-79,'2017-06-17 07:45:45',1),(98,-79,'2017-06-17 07:45:45',1),(99,-79,'2017-06-17 07:45:46',1),(100,-79,'2017-06-17 07:45:48',1),(101,-79,'2017-06-17 07:45:48',1),(102,-87,'2017-06-17 07:45:49',1),(103,-95,'2017-06-17 07:45:49',1),(104,-200,'2017-06-17 07:45:50',1),(105,-61,'2017-06-17 07:45:50',1),(106,-39,'2017-06-17 07:45:50',1),(107,-39,'2017-06-17 07:45:51',1),(108,-39,'2017-06-17 07:45:51',1),(109,-39,'2017-06-17 07:45:52',1),(110,-39,'2017-06-17 07:45:52',1),(111,-39,'2017-06-17 07:45:53',1),(112,-39,'2017-06-17 07:45:53',1),(113,-39,'2017-06-17 07:45:54',1),(114,0,'2017-06-17 07:49:38',1),(115,40,'2017-06-17 07:50:14',1),(116,40,'2017-06-17 07:50:14',1),(117,40,'2017-06-17 07:50:15',1),(118,40,'2017-06-17 07:50:15',1),(119,40,'2017-06-17 07:50:16',1),(120,40,'2017-06-17 07:50:16',1),(121,40,'2017-06-17 07:50:17',1),(122,40,'2017-06-17 07:50:24',1),(123,40,'2017-06-17 07:50:24',1),(124,40,'2017-06-17 07:50:25',1),(125,0,'2017-06-17 07:50:40',1),(126,0,'2017-06-17 07:50:40',1),(127,0,'2017-06-17 07:50:41',1),(128,0,'2017-06-17 07:50:41',1),(129,0,'2017-06-17 07:50:42',1),(130,0,'2017-06-17 07:50:42',1),(131,0,'2017-06-17 07:50:43',1),(132,40,'2017-06-17 07:50:47',1),(133,40,'2017-06-17 07:50:48',1),(134,40,'2017-06-17 07:50:48',1),(135,40,'2017-06-17 07:50:48',1),(136,40,'2017-06-17 07:50:49',1),(137,40,'2017-06-17 07:50:49',1),(138,40,'2017-06-17 07:50:50',1),(139,0,'2017-06-17 07:52:35',1),(140,0,'2017-06-17 07:53:37',1),(141,0,'2017-06-17 07:53:37',1),(142,0,'2017-06-17 07:53:38',1),(143,0,'2017-06-17 07:53:38',1),(144,0,'2017-06-17 07:53:39',1),(145,0,'2017-06-17 07:53:39',1),(146,0,'2017-06-17 07:53:39',1),(147,0,'2017-06-17 07:53:46',1),(148,0,'2017-06-17 07:53:46',1),(149,0,'2017-06-17 07:53:47',1),(150,0,'2017-06-17 07:53:47',1),(151,0,'2017-06-17 07:54:20',1),(152,0,'2017-06-17 07:54:20',1),(153,0,'2017-06-17 07:54:21',1),(154,0,'2017-06-17 07:54:21',1),(155,0,'2017-06-17 07:54:21',1),(156,0,'2017-06-17 07:54:22',1),(157,0,'2017-06-17 07:54:22',1),(158,0,'2017-06-17 07:54:23',1),(159,0,'2017-06-17 07:55:12',1),(160,0,'2017-06-17 07:55:12',1),(161,0,'2017-06-17 07:55:13',1),(162,0,'2017-06-17 07:55:13',1),(163,0,'2017-06-17 07:55:29',1),(164,0,'2017-06-17 07:55:29',1),(165,0,'2017-06-17 07:55:30',1),(166,0,'2017-06-17 07:55:30',1),(167,0,'2017-06-17 07:55:31',1),(168,0,'2017-06-17 07:55:31',1),(169,0,'2017-06-17 07:55:32',1),(170,0,'2017-06-17 07:55:32',1),(171,0,'2017-06-17 08:00:33',1),(172,0,'2017-06-17 08:00:34',1),(173,0,'2017-06-17 08:00:35',1),(174,0,'2017-06-17 08:00:35',1),(175,0,'2017-06-17 08:00:35',1),(176,0,'2017-06-17 08:00:36',1),(177,0,'2017-06-17 08:03:07',1),(178,0,'2017-06-17 08:03:29',1),(179,0,'2017-06-17 08:03:29',1),(180,0,'2017-06-17 08:03:30',1),(181,0,'2017-06-17 08:03:30',1),(182,0,'2017-06-17 08:03:31',1),(183,0,'2017-06-17 08:03:31',1),(184,30,'2017-06-17 08:17:09',1),(185,50,'2017-06-17 08:17:10',1),(186,0,'2017-06-17 08:17:39',1),(187,25,'2017-06-17 08:17:49',1),(188,0,'2017-06-17 08:17:56',1),(189,4,'2017-06-17 08:18:04',1),(190,289,'2017-06-17 08:18:04',1),(191,500,'2017-06-17 08:18:05',1),(192,348,'2017-06-17 08:18:21',1),(193,0,'2017-06-17 08:18:22',1),(194,52,'2017-06-17 08:46:25',1),(195,191,'2017-06-17 08:46:26',1),(196,168,'2017-06-17 08:47:30',1),(197,123,'2017-06-17 08:47:30',1),(198,246,'2017-06-17 08:47:31',1),(199,88,'2017-06-17 08:47:31',1),(200,191,'2017-06-17 08:47:32',1),(201,165,'2017-06-17 08:47:38',1),(202,60,'2017-06-17 09:22:30',1);

--
-- Table structure for table `tblfoodsettings`
--

CREATE TABLE `tblfoodsettings` (
  `food_settings_id` int(11) NOT NULL AUTO_INCREMENT,
  `amount_to_be_dispensed` int(11) NOT NULL,
  `time` datetime NOT NULL,
  `cumulative` tinyint(4) DEFAULT NULL,
  PRIMARY KEY (`food_settings_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tblfoodsettings`
--

INSERT INTO `tblfoodsettings` VALUES (1,30,'2017-01-01 15:15:00',1),(2,88,'2017-01-01 15:17:00',1),(3,77,'2017-01-01 15:18:00',1),(4,77,'2017-01-01 15:19:00',1),(5,77,'2017-01-01 15:21:00',1),(6,7,'2017-01-01 15:22:00',1),(7,50,'0000-00-00 00:00:00',1),(8,50,'2007-03-00 00:00:00',1),(9,50,'2017-06-13 09:56:20',1),(10,50,'2017-06-13 09:56:20',1),(11,40,'2017-06-13 09:56:20',1),(12,40,'2017-06-13 09:56:20',0),(13,40,'2017-06-13 09:56:20',0),(14,40,'2017-01-01 05:05:00',0);

--
-- Table structure for table `tblprovision`
--

CREATE TABLE `tblprovision` (
  `provision_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `percentage_left` int(10) DEFAULT NULL,
  `timestamp` datetime DEFAULT NULL,
  `dog_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`provision_id`,`dog_id`),
  KEY `fk_tblprovision_tbldog1_idx` (`dog_id`),
  CONSTRAINT `fk_tblprovision_tbldog1` FOREIGN KEY (`dog_id`) REFERENCES `tbldog` (`dog_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tblprovision`
--

INSERT INTO `tblprovision` VALUES (1,100,'2017-06-16 07:00:00',1),(2,80,'2017-06-16 12:00:00',1),(3,75,'2017-06-17 09:17:37',1),(4,10,'2017-06-17 09:29:56',1),(5,10,'2017-06-17 09:23:59',1),(6,10,'2017-06-17 09:28:08',1),(7,10,'2017-06-17 09:21:48',1),(8,10,'2017-06-17 09:30:52',1),(9,10,'2017-06-17 09:20:45',1),(10,10,'2017-06-19 12:46:23',1);

--
-- Dumping events for database 'petfeeder_db'
--

--
-- Dumping routines for database 'petfeeder_db'
--


