-- http://www.phpmyadmin.net
--




--
-- Database: `tateho5_homeassistant`
--
CREATE DATABASE IF NOT EXISTS `tateho5_homeassistant` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `tateho5_homeassistant`;

-- --------------------------------------------------------

--
-- Table structure for table `activemsg`
--

CREATE TABLE IF NOT EXISTS `activemsg` (
  `ActiveMsgID` int(11) unsigned NOT NULL,
  `MsgListID` int(11) unsigned NOT NULL,
  `GroupID` int(11) NOT NULL,
  `MsgStartDateTime` datetime NOT NULL,
  `MsgEndDateTime` datetime NOT NULL,
  `ResponseID` int(11) unsigned NOT NULL,
  `ErrorID` int(11) unsigned NOT NULL,
  `LastTimeMsgDisplayed` datetime NOT NULL,
  `NumTimesRetried` int(11) unsigned NOT NULL,
  `NumTimesDisplayed` int(11) NOT NULL,
  `Selected` tinyint(1) NOT NULL,
  `Done` tinyint(1) NOT NULL,
  `Ready` tinyint(1) NOT NULL,
  `Enabled` tinyint(1) NOT NULL,
  `Sync` tinyint(1) NOT NULL,
  `Wait` tinyint(1) NOT NULL,
  `Triggered` int(11) NOT NULL,
  `Linked` tinyint(1) NOT NULL,
  `Locked` int(11) NOT NULL,
  `Stop` int(11) NOT NULL,
  `ActiveStartDateTime` datetime NOT NULL,
  `ActiveEndDateTime` datetime NOT NULL,
  `LastResetDateTime` datetime NOT NULL,
  `SelectedDeviceID` int(11) NOT NULL,
  `ActMsgDeleted` tinyint(1) NOT NULL,
  `ActMsgDeletedDateTime` datetime NOT NULL,
  PRIMARY KEY (`ActiveMsgID`,`GroupID`),
  KEY `GroupID` (`GroupID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `activemsg`
--

INSERT INTO `activemsg` (`ActiveMsgID`, `MsgListID`, `GroupID`, `MsgStartDateTime`, `MsgEndDateTime`, `ResponseID`, `ErrorID`, `LastTimeMsgDisplayed`, `NumTimesRetried`, `NumTimesDisplayed`, `Selected`, `Done`, `Ready`, `Enabled`, `Sync`, `Wait`, `Triggered`, `Linked`, `Locked`, `Stop`, `ActiveStartDateTime`, `ActiveEndDateTime`, `LastResetDateTime`, `SelectedDeviceID`, `ActMsgDeleted`, `ActMsgDeletedDateTime`) VALUES
(320, 328, 28, '2017-05-02 20:50:00', '2017-05-02 20:50:13', 1, 0, '2017-05-02 20:50:00', 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, '2017-05-02 20:48:30', '2017-03-26 20:18:52', '2017-05-02 19:39:42', 0, 0, '1993-07-08 00:00:00'),
(321, 329, 28, '2017-05-02 20:50:37', '2017-05-02 20:50:49', 1, 0, '2017-05-02 20:50:37', 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, '2017-05-02 20:48:30', '1993-07-08 00:00:00', '2017-05-02 19:39:42', 0, 0, '1993-07-08 00:00:00'),
(322, 330, 28, '2017-05-02 20:50:13', '2017-05-02 20:50:25', 1, 0, '2017-05-02 20:50:13', 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, '2017-05-02 20:48:30', '2017-03-22 21:25:39', '2017-05-02 19:39:42', 0, 0, '1993-07-08 00:00:00'),
(323, 331, 28, '2017-05-02 20:51:01', '1993-07-08 00:00:00', 0, 0, '2017-05-02 20:51:01', 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, '2017-05-02 20:48:30', '1993-07-08 00:00:00', '2017-05-02 19:43:56', 28, 0, '1993-07-08 00:00:00'),
(324, 332, 28, '2017-05-02 20:49:48', '2017-05-02 20:50:00', 1, 0, '2017-05-02 20:49:48', 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, '2017-05-02 20:48:30', '1993-07-08 00:00:00', '2017-05-02 19:39:42', 0, 0, '1993-07-08 00:00:00'),
(373, 381, 28, '1993-07-08 00:00:00', '1993-07-08 00:00:00', 0, 0, '1993-07-08 00:00:00', 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '2017-05-02 20:49:47', '1993-07-08 00:00:00', '2017-05-02 20:49:47', 0, 0, '1993-07-08 00:00:00'),
(374, 382, 28, '2017-05-02 20:50:49', '2017-05-02 20:51:01', 1, 0, '2017-05-02 20:50:49', 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '2017-05-02 20:50:12', '1993-07-08 00:00:00', '2017-05-02 20:50:12', 0, 0, '1993-07-08 00:00:00');

-- --------------------------------------------------------

--
-- Table structure for table `activemsglinks`
--

CREATE TABLE IF NOT EXISTS `activemsglinks` (
  `MsgLinksID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `GroupID` int(11) NOT NULL,
  `MsgID` int(11) NOT NULL,
  `ResponseID` int(10) unsigned NOT NULL,
  `LinkedMsgID` int(11) NOT NULL,
  `LinkedFunctionID` int(11) NOT NULL,
  PRIMARY KEY (`MsgLinksID`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ;

--
-- Dumping data for table `activemsglinks`
--

INSERT INTO `activemsglinks` (`MsgLinksID`, `GroupID`, `MsgID`, `ResponseID`, `LinkedMsgID`, `LinkedFunctionID`) VALUES
(13, 28, 380, 1, 0, 0),
(14, 28, 380, 2, 0, 0),
(15, 28, 380, 3, 0, 1),
(16, 28, 380, 4, 0, 0);

-- --------------------------------------------------------

--
-- Table structure for table `devicemsgque`
--

CREATE TABLE IF NOT EXISTS `devicemsgque` (
  `MsgTableID` int(20) unsigned NOT NULL AUTO_INCREMENT,
  `GroupID` int(11) NOT NULL,
  `DeviceID` int(11) NOT NULL,
  `Message` varchar(1000) NOT NULL,
  `StatusDateTime` datetime NOT NULL,
  `MsgStatus` varchar(15) NOT NULL,
  `Direction` varchar(15) NOT NULL,
  PRIMARY KEY (`MsgTableID`),
  UNIQUE KEY `MsgTableID` (`MsgTableID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=14317 ;

--
-- Dumping data for table `devicemsgque`
--

INSERT INTO `devicemsgque` (`MsgTableID`, `GroupID`, `DeviceID`, `Message`, `StatusDateTime`, `MsgStatus`, `Direction`) VALUES
(14297, 28, 28, '<AJAX_CMD>BROWSER_RESTART</AJAX_CMD>', '2017-05-02 20:48:33', 'HANDLED', 'TO_DEVICE'),
(14298, 28, 28, '<AJAX_CMD>UPDATE</AJAX_CMD><ACT_MSG_ID>0</ACT_MSG_ID><PAGE_TYPE>0</PAGE_TYPE><USER_PRESENCE>99.64440007209778</USER_PRESENCE><AVATAR_TALKS>0</AVATAR_TALKS><PAGE_STATE>AVATAR_NOT_LOADED</PAGE_STATE><STATUS_NAME>PAGE_LOADED_TIME</STATUS_NAME><STATUS_DATA>1493772511.69</STATUS_DATA><ERROR_ID>0</ERROR_ID>', '2017-05-02 20:48:33', 'HANDLED', 'INBOUND'),
(14299, 28, 28, '<AJAX_CMD>UPDATE</AJAX_CMD><ACT_MSG_ID>0</ACT_MSG_ID><PAGE_TYPE>0</PAGE_TYPE><USER_PRESENCE>98.25139989852904</USER_PRESENCE><AVATAR_TALKS>0</AVATAR_TALKS><PAGE_STATE>WAIT_FOR_MESSAGE</PAGE_STATE><STATUS_NAME>RECEIVED_MSGS</STATUS_NAME><STATUS_DATA>1</STATUS_DATA><ERROR_ID>0</ERROR_ID>', '2017-05-02 20:48:53', 'HANDLED', 'INBOUND'),
(14300, 28, 28, '<AJAX_CMD>UPDATE</AJAX_CMD><ACT_MSG_ID>0</ACT_MSG_ID><PAGE_TYPE>0</PAGE_TYPE><USER_PRESENCE>84.60910000801087</USER_PRESENCE><AVATAR_TALKS>0</AVATAR_TALKS><PAGE_STATE>WAIT_FOR_MESSAGE</PAGE_STATE><STATUS_NAME>SENT_MSGS</STATUS_NAME><STATUS_DATA>2</STATUS_DATA><ERROR_ID>0</ERROR_ID>', '2017-05-02 20:49:14', 'HANDLED', 'INBOUND'),
(14301, 28, 28, '<AJAX_CMD>UPDATE</AJAX_CMD><ACT_MSG_ID>0</ACT_MSG_ID><PAGE_TYPE>0</PAGE_TYPE><USER_PRESENCE>84.60910000801087</USER_PRESENCE><AVATAR_TALKS>0</AVATAR_TALKS><PAGE_STATE>WAIT_FOR_MESSAGE</PAGE_STATE><STATUS_NAME>RETRIED_MSGS</STATUS_NAME><STATUS_DATA>0</STATUS_DATA><ERROR_ID>0</ERROR_ID>', '2017-05-02 20:49:35', 'HANDLED', 'INBOUND'),
(14302, 28, 28, '<AJAX_CMD>MESSAGE</AJAX_CMD><ACT_MSG_ID>320</ACT_MSG_ID><MSG_TYPE>1</MSG_TYPE><SPOKEN_TEXT>Today the trash goes out to the curb for pickup.</SPOKEN_TEXT><DISPLAY_TEXT>Today the trash goes out to the curb for pickup.</DISPLAY_TEXT>', '2017-05-02 20:49:36', 'SENDING', 'OUTBOUND'),
(14303, 28, 28, '<AJAX_CMD>RESPONSE</AJAX_CMD><ACT_MSG_ID>320</ACT_MSG_ID><RESPONSE>NONE</RESPONSE><RESP_METHOD></RESP_METHOD><RESP_TIME>0</RESP_TIME><MSG_START>0</MSG_START><MSG_END>0</MSG_END><AVATAR_TALKS>0</AVATAR_TALKS><USER_REQS>0</USER_REQS><USER_RETRIES>0</USER_RETRIES><USER_PRESENCE>82.84860010147095</USER_PRESENCE><ERROR_ID>0</ERROR_ID>', '2017-05-02 20:49:48', 'HANDLED', 'INBOUND'),
(14304, 28, 28, '<AJAX_CMD>MESSAGE</AJAX_CMD><ACT_MSG_ID>324</ACT_MSG_ID><MSG_TYPE>1</MSG_TYPE><SPOKEN_TEXT>Get the most out of every day.  Eat healthy, exercise and stay positive.</SPOKEN_TEXT><DISPLAY_TEXT>Get the most out of every day.  Eat healthy, exercise and stay positive.</DISPLAY_TEXT>', '2017-05-02 20:49:48', 'SENDING', 'OUTBOUND'),
(14305, 28, 28, '<AJAX_CMD>RESPONSE</AJAX_CMD><ACT_MSG_ID>324</ACT_MSG_ID><RESPONSE>NONE</RESPONSE><RESP_METHOD></RESP_METHOD><RESP_TIME>0</RESP_TIME><MSG_START>0</MSG_START><MSG_END>0</MSG_END><AVATAR_TALKS>0</AVATAR_TALKS><USER_REQS>0</USER_REQS><USER_RETRIES>0</USER_RETRIES><USER_PRESENCE>74.1097999572754</USER_PRESENCE><ERROR_ID>0</ERROR_ID>', '2017-05-02 20:50:00', 'HANDLED', 'INBOUND'),
(14306, 28, 28, '<AJAX_CMD>MESSAGE</AJAX_CMD><ACT_MSG_ID>320</ACT_MSG_ID><MSG_TYPE>1</MSG_TYPE><SPOKEN_TEXT>Today the trash goes out to the curb for pickup.</SPOKEN_TEXT><DISPLAY_TEXT>Today the trash goes out to the curb for pickup.</DISPLAY_TEXT>', '2017-05-02 20:50:00', 'SENDING', 'OUTBOUND'),
(14307, 28, 28, '<AJAX_CMD>RESPONSE</AJAX_CMD><ACT_MSG_ID>320</ACT_MSG_ID><RESPONSE>NONE</RESPONSE><RESP_METHOD></RESP_METHOD><RESP_TIME>0</RESP_TIME><MSG_START>0</MSG_START><MSG_END>0</MSG_END><AVATAR_TALKS>0</AVATAR_TALKS><USER_REQS>0</USER_REQS><USER_RETRIES>0</USER_RETRIES><USER_PRESENCE>65.35910000801087</USER_PRESENCE><ERROR_ID>0</ERROR_ID>', '2017-05-02 20:50:13', 'HANDLED', 'INBOUND'),
(14308, 28, 28, '<AJAX_CMD>MESSAGE</AJAX_CMD><ACT_MSG_ID>322</ACT_MSG_ID><MSG_TYPE>1</MSG_TYPE><SPOKEN_TEXT>This may be recycle day.</SPOKEN_TEXT><DISPLAY_TEXT>This may be recycle day.</DISPLAY_TEXT>', '2017-05-02 20:50:13', 'SENDING', 'OUTBOUND'),
(14309, 28, 28, '<AJAX_CMD>RESPONSE</AJAX_CMD><ACT_MSG_ID>322</ACT_MSG_ID><RESPONSE>NONE</RESPONSE><RESP_METHOD></RESP_METHOD><RESP_TIME>0</RESP_TIME><MSG_START>0</MSG_START><MSG_END>0</MSG_END><AVATAR_TALKS>0</AVATAR_TALKS><USER_REQS>0</USER_REQS><USER_RETRIES>0</USER_RETRIES><USER_PRESENCE>80</USER_PRESENCE><ERROR_ID>0</ERROR_ID>', '2017-05-02 20:50:25', 'HANDLED', 'INBOUND'),
(14310, 28, 28, '<AJAX_CMD>MESSAGE</AJAX_CMD><ACT_MSG_ID>374</ACT_MSG_ID><MSG_TYPE>1</MSG_TYPE><SPOKEN_TEXT>And your next sticky note is.</SPOKEN_TEXT><DISPLAY_TEXT>And your next sticky note is.</DISPLAY_TEXT>', '2017-05-02 20:50:25', 'SENDING', 'OUTBOUND'),
(14311, 28, 28, '<AJAX_CMD>RESPONSE</AJAX_CMD><ACT_MSG_ID>374</ACT_MSG_ID><RESPONSE>NONE</RESPONSE><RESP_METHOD></RESP_METHOD><RESP_TIME>0</RESP_TIME><MSG_START>0</MSG_START><MSG_END>0</MSG_END><AVATAR_TALKS>0</AVATAR_TALKS><USER_REQS>0</USER_REQS><USER_RETRIES>0</USER_RETRIES><USER_PRESENCE>80</USER_PRESENCE><ERROR_ID>0</ERROR_ID>', '2017-05-02 20:50:37', 'HANDLED', 'INBOUND'),
(14312, 28, 28, '<AJAX_CMD>MESSAGE</AJAX_CMD><ACT_MSG_ID>321</ACT_MSG_ID><MSG_TYPE>1</MSG_TYPE><SPOKEN_TEXT>Remember to change the water in the dogs dishes once a day.</SPOKEN_TEXT><DISPLAY_TEXT>Remember to change the water in the dogs dishes once a day.</DISPLAY_TEXT>', '2017-05-02 20:50:37', 'SENDING', 'OUTBOUND'),
(14313, 28, 28, '<AJAX_CMD>RESPONSE</AJAX_CMD><ACT_MSG_ID>321</ACT_MSG_ID><RESPONSE>NONE</RESPONSE><RESP_METHOD></RESP_METHOD><RESP_TIME>0</RESP_TIME><MSG_START>0</MSG_START><MSG_END>0</MSG_END><AVATAR_TALKS>0</AVATAR_TALKS><USER_REQS>0</USER_REQS><USER_RETRIES>0</USER_RETRIES><USER_PRESENCE>80</USER_PRESENCE><ERROR_ID>0</ERROR_ID>', '2017-05-02 20:50:49', 'HANDLED', 'INBOUND'),
(14314, 28, 28, '<AJAX_CMD>MESSAGE</AJAX_CMD><ACT_MSG_ID>374</ACT_MSG_ID><MSG_TYPE>1</MSG_TYPE><SPOKEN_TEXT>And your next sticky note is.</SPOKEN_TEXT><DISPLAY_TEXT>And your next sticky note is.</DISPLAY_TEXT>', '2017-05-02 20:50:49', 'SENDING', 'OUTBOUND'),
(14315, 28, 28, '<AJAX_CMD>RESPONSE</AJAX_CMD><ACT_MSG_ID>374</ACT_MSG_ID><RESPONSE>NONE</RESPONSE><RESP_METHOD></RESP_METHOD><RESP_TIME>0</RESP_TIME><MSG_START>0</MSG_START><MSG_END>0</MSG_END><AVATAR_TALKS>0</AVATAR_TALKS><USER_REQS>0</USER_REQS><USER_RETRIES>0</USER_RETRIES><USER_PRESENCE>80</USER_PRESENCE><ERROR_ID>0</ERROR_ID>', '2017-05-02 20:51:01', 'HANDLED', 'INBOUND'),
(14316, 28, 28, '<AJAX_CMD>MESSAGE</AJAX_CMD><ACT_MSG_ID>323</ACT_MSG_ID><MSG_TYPE>3</MSG_TYPE><SPOKEN_TEXT>This message tests the automatic play of to do list by selecting yes to this message.  Would you like to hear your To Do List?</SPOKEN_TEXT><DISPLAY_TEXT>This message tests the automatic play of to do list by selecting yes to this message.  Would you like to hear your To Do List?</DISPLAY_TEXT>', '2017-05-02 20:51:02', 'SENDING', 'OUTBOUND');

-- --------------------------------------------------------

--
-- Table structure for table `displayformat`
--

CREATE TABLE IF NOT EXISTS `displayformat` (
  `DisplayFormatID` int(11) NOT NULL,
  `DisplayFormatName` text NOT NULL,
  `Description` text NOT NULL,
  `MsgType` int(11) NOT NULL,
  UNIQUE KEY `DisplayFormatID_2` (`DisplayFormatID`),
  KEY `DisplayFormatID` (`DisplayFormatID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `displayformat`
--

INSERT INTO `displayformat` (`DisplayFormatID`, `DisplayFormatName`, `Description`, `MsgType`) VALUES
(0, 'ResponsePage005.php', 'No Message To Display Was 001.', 4),
(1, 'ResponsePage005.php', 'Message, but no response Required.  Was 000.', 1),
(2, 'ResponsePage005.php', 'Simple Acknowledge. Was 003', 2),
(3, 'ResponsePage005.php', 'Classic Yes or No Message Response format.  Was 001.', 3);

-- --------------------------------------------------------

--
-- Table structure for table `enablers`
--

CREATE TABLE IF NOT EXISTS `enablers` (
  `EnablerID` int(11) unsigned NOT NULL,
  `GroupID` int(11) NOT NULL,
  `UserID` int(11) NOT NULL,
  `DeviceID` int(11) NOT NULL,
  `EnablerDescription` text NOT NULL,
  `DaysOfWeek` int(11) NOT NULL,
  `MonthsOfYear1` int(11) NOT NULL,
  `MonthsOfYear2` int(11) NOT NULL,
  `WeeksOfMonth` int(10) unsigned NOT NULL,
  `DaysOfMonth1` int(10) unsigned NOT NULL,
  `DaysOfMonth2` int(10) unsigned NOT NULL,
  `DaysOfMonth3` int(10) unsigned NOT NULL,
  `DaysOfMonth4` int(10) unsigned NOT NULL,
  `MsgYears` int(10) unsigned NOT NULL COMMENT 'All, Odd, Even, Leap Year',
  `StartTime` time NOT NULL,
  `EndTime` time NOT NULL,
  `MsgRepeat` int(11) NOT NULL,
  `Random` tinyint(1) NOT NULL,
  `MaxAttempts` int(11) NOT NULL,
  `TriggerListID` int(11) NOT NULL,
  `EditStatus` tinyint(1) NOT NULL,
  `CreatedByUserID` int(11) NOT NULL,
  PRIMARY KEY (`EnablerID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `enablers`
--

INSERT INTO `enablers` (`EnablerID`, `GroupID`, `UserID`, `DeviceID`, `EnablerDescription`, `DaysOfWeek`, `MonthsOfYear1`, `MonthsOfYear2`, `WeeksOfMonth`, `DaysOfMonth1`, `DaysOfMonth2`, `DaysOfMonth3`, `DaysOfMonth4`, `MsgYears`, `StartTime`, `EndTime`, `MsgRepeat`, `Random`, `MaxAttempts`, `TriggerListID`, `EditStatus`, `CreatedByUserID`) VALUES
(1, 1, 0, 0, 'Always Enabled', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 86400, 0, 86400, 0, 0, 0),
(2, 1, 0, 0, 'Sticky Default', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 1, 0, 0, 0, 0, 0),
(3, 1, 0, 0, 'Fun Fact Default', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 1, 0, 0, 0, 0, 0),
(4, 1, 0, 0, 'Basic Reminder Default', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 288, 0, 1, 0, 0, 0),
(5, 1, 0, 0, 'Immediate Reminder Default', 127, 63, 63, 31, 255, 255, 255, 255, 15, '05:00:00', '05:45:00', 0, 0, 0, 0, 0, 0),
(6, 1, 0, 0, 'Date Time Reminder Default', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 288, 0, 1, 0, 0, 0),
(7, 1, 0, 0, 'Recurring Reminder Default', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 288, 0, 1, 0, 0, 0),
(8, 17, 0, 0, 'Everyday. All day long. Every 5 minutes.', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 288, 0, 1, 0, 0, 0),
(9, 28, 0, 0, 'Weekday morning wake up message.', 127, 63, 63, 31, 255, 255, 255, 255, 15, '05:00:00', '23:59:59', 96, 1, 1, 0, 0, 0),
(10, 28, 0, 0, 'Everyday. All day long. Every 5 minutes.', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 48, 0, 1, 0, 0, 0),
(239, 28, 0, 0, 'Everyday. All day long. Every 5 minutes.', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 48, 0, 1, 0, 0, 28),
(240, 28, 0, 0, 'Everyday. All day long. Every 5 minutes.', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 48, 0, 1, 0, 0, 28),
(241, 28, 0, 0, 'Everyday. All day long. Every 5 minutes.', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 48, 0, 1, 0, 0, 28),
(242, 28, 0, 0, 'Everyday. All day long. Every 5 minutes.', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 48, 0, 1, 0, 0, 28),
(243, 28, 0, 0, 'Everyday. All day long. Every 5 minutes.', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 48, 0, 1, 0, 0, 28),
(244, 28, 0, 0, 'Everyday. All day long. Every 5 minutes.', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 48, 0, 1, 0, 0, 28),
(245, 28, 0, 0, 'Everyday. All day long. Every 5 minutes.', 127, 255, 255, 31, 255, 255, 255, 255, 1, '01:00:00', '23:59:00', 288, 0, 1, 0, 0, 28),
(246, 28, 0, 0, 'Everyday. All day long. Every 5 minutes.', 127, 255, 255, 31, 255, 255, 255, 255, 1, '19:15:00', '19:20:00', 1, 0, 1, 0, 0, 28),
(247, 28, 0, 0, 'Everyday. All day long. Every 5 minutes.', 4, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 3, 0, 1, 0, 0, 28),
(248, 28, 0, 0, 'Everyday. All day long. Every 5 minutes.', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 3, 0, 1, 0, 0, 28),
(249, 28, 0, 0, 'Everyday. All day long. Every 5 minutes.', 4, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 3, 0, 1, 0, 0, 28),
(253, 28, 0, 0, 'Everyday. All day long. Every 5 minutes.', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 1, 1, 0, 0, 0, 0),
(254, 28, 0, 0, 'Everyday. All day long. Every 5 minutes.', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 3, 0, 0, 0, 0, 0),
(257, 28, 0, 0, 'Everyday. All day long. Every 5 minutes.', 127, 255, 255, 31, 255, 255, 255, 255, 1, '04:00:00', '23:59:00', 180, 0, 1, 0, 0, 28),
(303, 28, 0, 0, 'Always Enabled', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 86400, 0, 86400, 0, 0, 28),
(304, 28, 0, 0, 'Always Enabled', 127, 63, 63, 31, 255, 255, 255, 255, 15, '00:00:00', '23:59:59', 86400, 0, 86400, 0, 0, 28);

-- --------------------------------------------------------

--
-- Table structure for table `errors`
--

CREATE TABLE IF NOT EXISTS `errors` (
  `ErrorID` int(10) unsigned NOT NULL,
  `Description` text NOT NULL,
  PRIMARY KEY (`ErrorID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `errors`
--

INSERT INTO `errors` (`ErrorID`, `Description`) VALUES
(1, 'No User Response to Message');

-- --------------------------------------------------------

--
-- Table structure for table `groupinfo`
--

CREATE TABLE IF NOT EXISTS `groupinfo` (
  `SystemIndex` int(11) unsigned NOT NULL,
  `GroupID` int(11) NOT NULL,
  `MsgListIDNext` int(11) NOT NULL,
  `ActiveMsgIDNext` int(11) NOT NULL,
  `MsgIDNext` int(11) NOT NULL,
  `EnablerIDNext` int(10) unsigned NOT NULL,
  `SysMsgListIDNext` int(11) NOT NULL,
  `StickyIDNext` int(11) NOT NULL,
  `StickyListIDNext` int(11) NOT NULL,
  `StyleIDNext` int(11) NOT NULL,
  `StyleStatusID` int(11) NOT NULL,
  `StylesSubTypeID` int(11) NOT NULL,
  `ActiveMsgUpdateRate` int(11) NOT NULL,
  `ActiveMsgLastUpdate` datetime NOT NULL,
  `NoResponseTime` int(10) unsigned NOT NULL,
  `SysGrpLow` int(11) NOT NULL,
  `SysGrpHigh` int(11) NOT NULL,
  `LockDeviceID` int(11) NOT NULL,
  `LockDeviceTime` bigint(11) NOT NULL,
  `HistoryIndexIDNext` int(11) NOT NULL,
  PRIMARY KEY (`GroupID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `groupinfo`
--

INSERT INTO `groupinfo` (`SystemIndex`, `GroupID`, `MsgListIDNext`, `ActiveMsgIDNext`, `MsgIDNext`, `EnablerIDNext`, `SysMsgListIDNext`, `StickyIDNext`, `StickyListIDNext`, `StyleIDNext`, `StyleStatusID`, `StylesSubTypeID`, `ActiveMsgUpdateRate`, `ActiveMsgLastUpdate`, `NoResponseTime`, `SysGrpLow`, `SysGrpHigh`, `LockDeviceID`, `LockDeviceTime`, `HistoryIndexIDNext`) VALUES
(1, 1, 24, 1, 4, 12, 57, 1, 1, 0, 0, 0, 30, '2013-08-28 20:08:34', 600, 0, 0, 0, 0, 1),
(3, 5, 24, 1, 1, 12, 1, 1, 1, 0, 0, 0, 30, '2013-08-28 20:08:34', 600, 0, 0, 0, 0, 1),
(6, 8, 24, 1, 1, 12, 1, 1, 1, 0, 0, 0, 30, '2013-08-28 20:08:34', 600, 0, 0, 0, 0, 1),
(2, 11, 34, 10, 11, 12, 11, 33, 1, 0, 0, 0, 30, '2013-08-28 20:08:34', 600, 0, 0, 0, 0, 1),
(4, 15, 24, 1, 1, 12, 1, 3, 1, 0, 0, 0, 30, '2013-08-28 20:08:34', 600, 0, 0, 0, 0, 1),
(5, 17, 24, 1, 1, 12, 1, 4, 1, 0, 0, 0, 30, '2013-08-28 20:08:34', 600, 0, 0, 0, 0, 1),
(7, 28, 383, 375, 428, 305, 1, 9, 3, 8, 1, 1, 30, '2013-08-28 20:08:34', 600, 0, 0, 0, 0, 2910);

-- --------------------------------------------------------

--
-- Table structure for table `groups`
--

CREATE TABLE IF NOT EXISTS `groups` (
  `GroupID` int(11) NOT NULL,
  `GroupName` text NOT NULL,
  PRIMARY KEY (`GroupID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `groups`
--

INSERT INTO `groups` (`GroupID`, `GroupName`) VALUES
(0, 'System'),
(1, 'John R. DeShong'),
(5, 'Ruth Gruodis'),
(8, 'Jenny DeShong'),
(11, 'Bruce DeShong'),
(15, 'Christian DeShong'),
(17, 'Denise DeShong'),
(28, 'John R. DeShong');

-- --------------------------------------------------------

--
-- Table structure for table `history`
--

CREATE TABLE IF NOT EXISTS `history` (
  `HistoryIndexID` int(11) NOT NULL,
  `GroupID` int(11) NOT NULL,
  `DeviceID` int(11) NOT NULL,
  `UserID` int(11) NOT NULL,
  `Event` varchar(15) NOT NULL,
  `StartDateTime` datetime NOT NULL,
  `EndDateTime` datetime NOT NULL,
  `MsgTitle` varchar(45) NOT NULL,
  `SpokenText` varchar(512) NOT NULL,
  `DisplayText` varchar(512) NOT NULL,
  `ResponseID` int(11) NOT NULL,
  `ErrorID` int(11) NOT NULL,
  `MsgID` int(11) NOT NULL,
  `EnablerID` int(11) NOT NULL,
  `DisplayFormatID` int(11) NOT NULL,
  PRIMARY KEY (`HistoryIndexID`,`GroupID`,`DeviceID`),
  UNIQUE KEY `HistoryIndex` (`GroupID`,`DeviceID`,`HistoryIndexID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `history`
--

INSERT INTO `history` (`HistoryIndexID`, `GroupID`, `DeviceID`, `UserID`, `Event`, `StartDateTime`, `EndDateTime`, `MsgTitle`, `SpokenText`, `DisplayText`, `ResponseID`, `ErrorID`, `MsgID`, `EnablerID`, `DisplayFormatID`) VALUES
(2903, 28, 28, 28, 'Message', '2017-05-02 20:49:36', '2017-05-02 20:49:48', 'Trash Day', 'Today the trash goes out to the curb for pickup.', 'Today the trash goes out to the curb for pickup.', 1, 0, 370, 247, 1),
(2904, 28, 28, 28, 'Message', '2017-05-02 20:49:48', '2017-05-02 20:50:00', 'Have a Nice Day', 'Get the most out of every day.  Eat healthy, exercise and stay positive.', 'Get the most out of every day.  Eat healthy, exercise and stay positive.', 1, 0, 373, 254, 1),
(2905, 28, 28, 28, 'Message', '2017-05-02 20:50:00', '2017-05-02 20:50:13', 'Trash Day', 'Today the trash goes out to the curb for pickup.', 'Today the trash goes out to the curb for pickup.', 1, 0, 370, 247, 1),
(2906, 28, 28, 28, 'Message', '2017-05-02 20:50:13', '2017-05-02 20:50:25', 'Recycle Day', 'This may be recycle day.', 'This may be recycle day.', 1, 0, 372, 249, 1),
(2907, 28, 28, 28, 'Message', '2017-05-02 20:50:25', '2017-05-02 20:50:37', 'Next sticky message.', 'And your next sticky note is.', 'And your next sticky note is.', 1, 0, 427, 304, 1),
(2908, 28, 28, 28, 'Message', '2017-05-02 20:50:37', '2017-05-02 20:50:49', 'Dogs Water Dish', 'Remember to change the water in the dogs dishes once a day.', 'Remember to change the water in the dogs dishes once a day.', 1, 0, 371, 248, 1),
(2909, 28, 28, 28, 'Message', '2017-05-02 20:50:49', '2017-05-02 20:51:01', 'Next sticky message.', 'And your next sticky note is.', 'And your next sticky note is.', 1, 0, 427, 304, 1);

-- --------------------------------------------------------

--
-- Table structure for table `messages`
--

CREATE TABLE IF NOT EXISTS `messages` (
  `MsgIndex` int(11) NOT NULL AUTO_INCREMENT,
  `MsgID` int(11) unsigned NOT NULL,
  `GroupID` int(11) NOT NULL,
  `UserID` int(11) NOT NULL,
  `DeviceID` int(11) NOT NULL,
  `MsgTitle` text NOT NULL,
  `MsgDisplayText` text NOT NULL,
  `MsgSpokenText` text NOT NULL,
  `MsgType` int(11) unsigned NOT NULL,
  `DisplayFormatID` int(11) NOT NULL,
  `StyleID` int(11) NOT NULL,
  `SysMsg` int(10) unsigned NOT NULL,
  `FixedEnabler` int(11) NOT NULL,
  `MsgCreationDateTime` datetime NOT NULL,
  `MsgStartDateTime` datetime NOT NULL,
  `MsgNeverExpire` tinyint(1) NOT NULL,
  `MsgExpirationDateTime` datetime NOT NULL,
  `MsgExpired` tinyint(1) NOT NULL,
  `MsgSuspend` tinyint(1) NOT NULL,
  `MsgDeleted` tinyint(1) NOT NULL,
  `MsgDeleteDateTime` datetime NOT NULL,
  `MsgSuspendedDateTime` datetime NOT NULL,
  `EditStatus` tinyint(1) NOT NULL,
  `CreatedByUserID` int(11) NOT NULL,
  PRIMARY KEY (`MsgIndex`),
  KEY `GroupID` (`GroupID`,`UserID`,`DeviceID`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=401 ;

--
-- Dumping data for table `messages`
--

INSERT INTO `messages` (`MsgIndex`, `MsgID`, `GroupID`, `UserID`, `DeviceID`, `MsgTitle`, `MsgDisplayText`, `MsgSpokenText`, `MsgType`, `DisplayFormatID`, `StyleID`, `SysMsg`, `FixedEnabler`, `MsgCreationDateTime`, `MsgStartDateTime`, `MsgNeverExpire`, `MsgExpirationDateTime`, `MsgExpired`, `MsgSuspend`, `MsgDeleted`, `MsgDeleteDateTime`, `MsgSuspendedDateTime`, `EditStatus`, `CreatedByUserID`) VALUES
(1, 1, 1, 0, 0, 'Sticky Header', 'You have at least one Sticky Note.  Your sticky Notes are as follows.', 'You have at least one Sticky Note.  Your sticky Notes are as follows.', 1, 1, 1021, 1, 0, '2012-10-29 18:48:28', '0000-00-00 00:00:00', 0, '2012-10-29 00:00:00', 0, 0, 0, '2012-10-29 00:00:00', '2012-10-29 00:00:00', 0, 0),
(2, 2, 1, 0, 0, 'Next sticky message.', 'And your next sticky note is.', 'And your next sticky note is.', 1, 1, 1022, 1, 0, '2012-10-29 18:51:12', '0000-00-00 00:00:00', 0, '2012-10-29 00:00:00', 0, 0, 0, '2012-10-29 00:00:00', '2012-10-29 00:00:00', 0, 0),
(3, 3, 1, 0, 0, 'End of Stickies.', 'Those are all the sticky notes that you have.', 'Those are all the sticky notes that you have.', 1, 1, 1023, 1, 0, '2013-09-30 00:00:00', '0000-00-00 00:00:00', 0, '2013-10-01 00:00:00', 0, 0, 0, '2013-10-01 00:00:00', '2013-10-01 00:00:00', 0, 0),
(4, 4, 1, 0, 0, 'Fun Facts Header', 'I thought you would be interested in this fun fact for today', 'I thought you would be interested in this fun fact for today', 1, 1, 1026, 1, 0, '2013-09-30 00:00:00', '0000-00-00 00:00:00', 0, '2013-10-01 00:00:00', 0, 0, 0, '2013-10-01 00:00:00', '2013-10-01 00:00:00', 0, 0),
(7, 5, 1, 0, 0, 'John Lennon About Life', 'When John Lennon was a child his mother always told him to be happy in life.  When asked in school what John Lennon wanted to be when he grew up, he answered happy.  The teacher told him that he didn''t understand the question. John Lennon answered that the teacher didn''t understand what was important in life.', 'When John Lennon was a child his mother always told him to be happy in life.  When asked in school what John Lennon wanted to be when he grew up, he answered happy.  The teacher told him that he didn''t understand the question. John Lennon answered that the teacher didn''t understand what was important in life.', 1, 1, 1025, 1, 0, '2013-09-30 00:00:00', '0000-00-00 00:00:00', 0, '2013-10-01 00:00:00', 0, 0, 0, '2013-10-01 00:00:00', '2013-10-01 00:00:00', 0, 0),
(343, 370, 28, 28, 0, 'Trash Day', 'Today the trash goes out to the curb for pickup.', 'Today the trash goes out to the curb for pickup.', 1, 1, 1020, 0, 0, '2016-12-17 20:00:27', '2016-12-17 20:00:27', 1, '1993-07-08 00:00:00', 0, 0, 0, '1993-07-08 00:00:00', '1993-07-08 00:00:00', 1, 28),
(344, 371, 28, 28, 0, 'Dogs Water Dish', 'Remember to change the water in the dogs dishes once a day.', 'Remember to change the water in the dogs dishes once a day.', 1, 1, 1020, 0, 0, '2016-12-17 20:00:47', '2016-12-17 20:00:47', 1, '1993-07-08 00:00:00', 0, 0, 0, '1993-07-08 00:00:00', '1993-07-08 00:00:00', 1, 28),
(345, 372, 28, 28, 0, 'Recycle Day', 'This may be recycle day.', 'This may be recycle day.', 1, 1, 1020, 0, 0, '2016-12-17 20:00:58', '2016-12-17 20:00:58', 1, '1993-07-08 00:00:00', 0, 0, 0, '1993-07-08 00:00:00', '1993-07-08 00:00:00', 1, 28),
(346, 373, 28, 28, 0, 'Have a Nice Day', 'Get the most out of every day.  Eat healthy, exercise and stay positive.', 'Get the most out of every day.  Eat healthy, exercise and stay positive.', 1, 1, 1020, 0, 0, '2016-12-17 20:00:58', '2016-12-17 20:00:58', 1, '1993-07-08 00:00:00', 0, 0, 0, '1993-07-08 00:00:00', '1993-07-08 00:00:00', 1, 28),
(353, 380, 28, 28, 0, 'Test Linked Function 1', 'This message tests the automatic play of to do list by selecting yes to this message.  Would you like to hear your To Do List?', 'This message tests the automatic play of to do list by selecting yes to this message.  Would you like to hear your To Do List?', 3, 3, 1015, 0, 0, '2017-02-05 17:41:25', '2017-02-05 17:39:00', 0, '2017-02-05 17:39:00', 0, 0, 0, '1993-07-08 00:00:00', '1993-07-08 00:00:00', 1, 28),
(399, 426, 28, 0, 0, 'Sticky Header', 'You have at least one Sticky Note.  Your sticky Notes are as follows.', 'You have at least one Sticky Note.  Your sticky Notes are as follows.', 1, 1, 1021, 1, 0, '2012-10-29 18:48:28', '0000-00-00 00:00:00', 0, '2012-10-29 00:00:00', 0, 0, 0, '2012-10-29 00:00:00', '2012-10-29 00:00:00', 1, 28),
(400, 427, 28, 0, 0, 'Next sticky message.', 'And your next sticky note is.', 'And your next sticky note is.', 1, 1, 1022, 1, 0, '2012-10-29 18:51:12', '0000-00-00 00:00:00', 0, '2012-10-29 00:00:00', 0, 0, 0, '2012-10-29 00:00:00', '2012-10-29 00:00:00', 1, 28);

-- --------------------------------------------------------

--
-- Table structure for table `msgfunctions`
--

CREATE TABLE IF NOT EXISTS `msgfunctions` (
  `MsgFunctionID` int(10) unsigned NOT NULL,
  `Description` text NOT NULL,
  PRIMARY KEY (`MsgFunctionID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `msgfunctions`
--

INSERT INTO `msgfunctions` (`MsgFunctionID`, `Description`) VALUES
(1, 'Set preference to use the User''s first name.'),
(2, 'Set preference to use the User''s Nick name.');

-- --------------------------------------------------------

--
-- Table structure for table `msglist`
--

CREATE TABLE IF NOT EXISTS `msglist` (
  `MsgListID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `MsgID` int(11) NOT NULL,
  `EnablerID` int(11) NOT NULL,
  `GroupID` int(11) NOT NULL,
  `UserID` int(11) NOT NULL,
  `DeviceID` int(11) NOT NULL,
  `AddedByUserID` int(11) NOT NULL,
  `AddedDateTime` datetime NOT NULL,
  `EditStatus` smallint(6) NOT NULL,
  UNIQUE KEY `MsgListID_3` (`MsgListID`,`GroupID`),
  KEY `GroupID` (`GroupID`,`UserID`,`DeviceID`),
  KEY `MsgListID` (`MsgListID`),
  KEY `MsgListID_2` (`MsgListID`,`GroupID`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=383 ;

--
-- Dumping data for table `msglist`
--

INSERT INTO `msglist` (`MsgListID`, `MsgID`, `EnablerID`, `GroupID`, `UserID`, `DeviceID`, `AddedByUserID`, `AddedDateTime`, `EditStatus`) VALUES
(328, 370, 247, 28, 28, 0, 11, '2016-12-17 20:00:27', 0),
(329, 371, 248, 28, 28, 0, 11, '2016-12-17 20:00:47', 0),
(330, 372, 249, 28, 28, 0, 11, '2016-12-17 20:00:59', 0),
(331, 380, 253, 28, 0, 0, 0, '2016-12-23 08:10:42', 0),
(332, 373, 254, 28, 0, 0, 0, '2016-12-23 08:10:42', 0),
(381, 426, 303, 28, 0, 0, 0, '2017-05-02 20:49:36', 0),
(382, 427, 304, 28, 0, 0, 0, '2017-05-02 20:50:00', 0);

-- --------------------------------------------------------

--
-- Table structure for table `msglog`
--

CREATE TABLE IF NOT EXISTS `msglog` (
  `MsgLogID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `MsgID` int(11) unsigned NOT NULL,
  `EnablerID` int(11) NOT NULL,
  `GroupID` int(11) NOT NULL,
  `UserID` int(11) NOT NULL,
  `DeviceID` int(11) NOT NULL,
  `MsgStartDateTime` datetime NOT NULL,
  `MsgEndDateTime` datetime NOT NULL,
  `ResponseID` int(11) unsigned NOT NULL,
  `ErrorID` int(11) unsigned NOT NULL,
  `NumTimesDisplayed` int(11) unsigned NOT NULL,
  `LastTimeMsgDisplayed` datetime NOT NULL,
  `MsgDisplayText` text NOT NULL,
  `MsgSpokenText` text NOT NULL,
  `LogDateTime` datetime NOT NULL,
  KEY `MsgLogID` (`MsgLogID`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=165 ;

--
-- Dumping data for table `msglog`
--

INSERT INTO `msglog` (`MsgLogID`, `MsgID`, `EnablerID`, `GroupID`, `UserID`, `DeviceID`, `MsgStartDateTime`, `MsgEndDateTime`, `ResponseID`, `ErrorID`, `NumTimesDisplayed`, `LastTimeMsgDisplayed`, `MsgDisplayText`, `MsgSpokenText`, `LogDateTime`) VALUES
(162, 1, 2, 1, 2, 0, '2013-10-08 12:58:54', '2013-10-08 12:59:55', 0, 0, 1, '2013-10-08 12:58:54', 'Hi, my name is Jenny and I''m your Personal Home Assistant.  ', 'Hi, my name is Jenny and I''m your Personal Home Assistant.  ', '2013-10-08 13:00:26'),
(163, 1, 2, 1, 2, 0, '2013-10-08 13:00:26', '2013-10-08 13:01:27', 0, 0, 2, '2013-10-08 13:00:26', 'Hi, my name is Jenny and I''m your Personal Home Assistant.  ', 'Hi, my name is Jenny and I''m your Personal Home Assistant.  ', '2013-10-08 13:01:58'),
(164, 1, 2, 1, 2, 1, '2013-10-08 13:01:58', '2013-10-08 13:02:01', 2, 0, 3, '2013-10-08 13:01:58', 'Hi, my name is Jenny and I''m your Personal Home Assistant.  ', 'Hi, my name is Jenny and I''m your Personal Home Assistant.  ', '2013-10-08 13:02:01');

-- --------------------------------------------------------

--
-- Table structure for table `msgresponses`
--

CREATE TABLE IF NOT EXISTS `msgresponses` (
  `MsgResponseTypeID` int(10) unsigned NOT NULL,
  `ReturnValue` text NOT NULL,
  `Description` text NOT NULL,
  PRIMARY KEY (`MsgResponseTypeID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `msgresponses`
--

INSERT INTO `msgresponses` (`MsgResponseTypeID`, `ReturnValue`, `Description`) VALUES
(1, 'NONE', 'No Response'),
(2, 'OK', 'Ok'),
(3, 'YES', 'Yes'),
(4, 'NO', 'No'),
(5, 'FAILED', 'Error occurred trying perform message.');

-- --------------------------------------------------------

--
-- Table structure for table `msgsynonyms`
--

CREATE TABLE IF NOT EXISTS `msgsynonyms` (
  `MsgSynonymID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `MsgID1` int(10) unsigned NOT NULL,
  `MsgID2` int(10) unsigned NOT NULL,
  PRIMARY KEY (`MsgSynonymID`),
  KEY `MsgID1` (`MsgID1`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `msgtyperesponses`
--

CREATE TABLE IF NOT EXISTS `msgtyperesponses` (
  `MsgTypeID` int(11) NOT NULL,
  `MsgResponseID` int(11) NOT NULL,
  KEY `MsgTypeID` (`MsgTypeID`),
  KEY `MsgTypeID_2` (`MsgTypeID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `msgtyperesponses`
--

INSERT INTO `msgtyperesponses` (`MsgTypeID`, `MsgResponseID`) VALUES
(1, 1),
(2, 2),
(3, 3),
(3, 4),
(2, 1),
(3, 1),
(1, 5),
(2, 5),
(3, 5);

-- --------------------------------------------------------

--
-- Table structure for table `msgtypes`
--

CREATE TABLE IF NOT EXISTS `msgtypes` (
  `msgtypeID` int(10) unsigned NOT NULL,
  `MsgTypeDescription` text NOT NULL,
  `NumChoices` int(11) NOT NULL,
  PRIMARY KEY (`msgtypeID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `msgtypes`
--

INSERT INTO `msgtypes` (`msgtypeID`, `MsgTypeDescription`, `NumChoices`) VALUES
(1, 'NORESPONSE', 0),
(2, 'ACK', 1),
(3, 'YESNO', 2);

-- --------------------------------------------------------

--
-- Table structure for table `orderinfo`
--

CREATE TABLE IF NOT EXISTS `orderinfo` (
  `TxnID` int(10) unsigned NOT NULL,
  `PurchasedDateTime` datetime NOT NULL,
  `PayerID` varchar(50) NOT NULL,
  `BuyerFirstName` varchar(30) NOT NULL,
  `BuyerLastName` varchar(30) NOT NULL,
  `BuyerEmail` varchar(50) NOT NULL,
  `ItemName` varchar(50) NOT NULL,
  `ItemNumber` varchar(25) NOT NULL,
  `Quantity` int(11) NOT NULL,
  `PaymentGross` int(11) NOT NULL,
  `PaymentTax` int(11) NOT NULL,
  `PaymentShipping` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `parameters`
--

CREATE TABLE IF NOT EXISTS `parameters` (
  `GroupID` int(11) NOT NULL,
  `ParameterID` int(11) NOT NULL,
  `Owner` text NOT NULL,
  `ParameterName` text NOT NULL,
  `ParameterValue` text NOT NULL,
  UNIQUE KEY `ParameterID` (`ParameterID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `parameters`
--

INSERT INTO `parameters` (`GroupID`, `ParameterID`, `Owner`, `ParameterName`, `ParameterValue`) VALUES
(0, 1, 'STICKY', 'ACTIVE', '0'),
(0, 2, 'STICKY', 'READY', '0'),
(0, 3, 'STICKY', 'DONE', '0');

-- --------------------------------------------------------

--
-- Table structure for table `pca_appointments`
--

CREATE TABLE IF NOT EXISTS `pca_appointments` (
  `AppointmentID` int(11) NOT NULL,
  `GroupID` int(11) NOT NULL,
  `AppointmentStartTime` datetime NOT NULL,
  `AppointmentEndTime` datetime NOT NULL,
  `ProviderID` int(11) NOT NULL,
  `ClientID` int(11) NOT NULL,
  PRIMARY KEY (`AppointmentID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `preferences`
--

CREATE TABLE IF NOT EXISTS `preferences` (
  `PreferenceID` int(11) NOT NULL AUTO_INCREMENT,
  `GroupID` int(11) NOT NULL,
  `UserID` int(11) NOT NULL,
  `DeviceID` int(11) NOT NULL,
  PRIMARY KEY (`PreferenceID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `sticky`
--

CREATE TABLE IF NOT EXISTS `sticky` (
  `StickyID` int(11) NOT NULL,
  `GroupID` int(11) NOT NULL,
  `DeviceID` int(11) NOT NULL,
  `UserID` int(11) NOT NULL,
  `Selected` smallint(1) NOT NULL,
  `Ready` smallint(1) NOT NULL,
  `Active` smallint(1) NOT NULL,
  `Done` smallint(1) NOT NULL,
  `NextMsgID` int(11) NOT NULL,
  `Count` int(10) unsigned NOT NULL,
  `LastPlayed` datetime NOT NULL,
  `SecondsToNextPlay` int(11) NOT NULL,
  `PlayAll` int(11) NOT NULL,
  PRIMARY KEY (`StickyID`),
  KEY `StickyID` (`StickyID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `sticky`
--

INSERT INTO `sticky` (`StickyID`, `GroupID`, `DeviceID`, `UserID`, `Selected`, `Ready`, `Active`, `Done`, `NextMsgID`, `Count`, `LastPlayed`, `SecondsToNextPlay`, `PlayAll`) VALUES
(8, 28, 28, 0, 1, 0, 0, 0, 320, 0, '2016-12-17 20:34:05', 0, 0);

-- --------------------------------------------------------

--
-- Table structure for table `stickylist`
--

CREATE TABLE IF NOT EXISTS `stickylist` (
  `StickyID` int(11) NOT NULL,
  `GroupID` int(11) NOT NULL,
  `ActiveMsgID` int(11) NOT NULL,
  `Done` smallint(1) NOT NULL,
  `MsgOrder` int(11) NOT NULL,
  PRIMARY KEY (`GroupID`,`ActiveMsgID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `stickylist`
--

INSERT INTO `stickylist` (`StickyID`, `GroupID`, `ActiveMsgID`, `Done`, `MsgOrder`) VALUES
(8, 28, 320, 0, 1),
(8, 28, 321, 0, 2),
(8, 28, 322, 0, 3);

-- --------------------------------------------------------

--
-- Table structure for table `stylelist`
--

CREATE TABLE IF NOT EXISTS `stylelist` (
  `StyleID` int(11) NOT NULL,
  `GroupID` int(11) NOT NULL,
  `UserID` int(11) NOT NULL,
  `ActiveMsgID` int(11) NOT NULL,
  `Ready` smallint(6) NOT NULL,
  `Selected` smallint(6) NOT NULL,
  `Done` smallint(1) NOT NULL,
  `SysMsg` int(11) NOT NULL,
  `MsgOrder` int(11) NOT NULL,
  `Played` smallint(6) NOT NULL,
  `Status` varchar(15) NOT NULL,
  PRIMARY KEY (`GroupID`,`ActiveMsgID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `stylelist`
--

INSERT INTO `stylelist` (`StyleID`, `GroupID`, `UserID`, `ActiveMsgID`, `Ready`, `Selected`, `Done`, `SysMsg`, `MsgOrder`, `Played`, `Status`) VALUES
(1020, 28, 28, 320, 0, 0, 0, 0, 1, 0, 'Valid'),
(1020, 28, 28, 321, 0, 0, 0, 0, 2, 1, 'Valid'),
(1020, 28, 28, 322, 0, 0, 0, 0, 3, 1, 'Valid'),
(1020, 28, 28, 324, 0, 0, 0, 0, 4, 1, 'Valid');

-- --------------------------------------------------------

--
-- Table structure for table `styles`
--

CREATE TABLE IF NOT EXISTS `styles` (
  `StyleID` int(11) NOT NULL AUTO_INCREMENT,
  `StyleName` text NOT NULL,
  `ShortDescription` text NOT NULL,
  `LongDescription` text NOT NULL,
  `DefaultEnablerID` int(11) NOT NULL,
  PRIMARY KEY (`StyleID`),
  UNIQUE KEY `StyleID_2` (`StyleID`),
  KEY `StyleID` (`StyleID`),
  KEY `StyleID_3` (`StyleID`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1029 ;

--
-- Dumping data for table `styles`
--

INSERT INTO `styles` (`StyleID`, `StyleName`, `ShortDescription`, `LongDescription`, `DefaultEnablerID`) VALUES
(1000, 'BASIC_REMINDER', 'Basic Reminder', 'Basic Reminder', 4),
(1005, 'IMMEDIATE_REMINDER', 'Immediate Message - No Response', 'Family Friends send the user a message that shows up as soon as possible for the user.', 5),
(1010, 'DATE_TIME_REMINDER', 'DATE TIME Reminder- No Response', 'Family Friends send the user a message that shows up as soon as possible for the user.', 6),
(1015, 'RECURRING_REMINDER', 'Recurring Reminder', 'A reminder that repeats at multiple times.', 7),
(1020, 'STICKY', 'STICKY messages', 'Sticky Note', 2),
(1021, 'STICKY_HEADER', 'STICKY first statement', '', 1),
(1022, 'STICKY_NEXT', 'STICKY next statement', '', 1),
(1023, 'STICKY_END', 'STICKY last statement.', '', 1),
(1025, 'FUNFACT', 'Fun facts messages tags.', '', 3),
(1026, 'FUNFACT_HEADER', 'Fun facts first statement', '', 1),
(1027, 'FUNFACT_NEXT', 'Next Fun Fact.', '', 1),
(1028, 'FUNFACT_END', 'Fun facts last statement.', '', 1);

-- --------------------------------------------------------

--
-- Table structure for table `stylestatus`
--

CREATE TABLE IF NOT EXISTS `stylestatus` (
  `StyleID` int(11) NOT NULL,
  `GroupID` int(11) NOT NULL,
  `DeviceID` int(11) NOT NULL,
  `UserID` int(11) NOT NULL,
  `StyleType` varchar(15) NOT NULL,
  `Version` int(11) NOT NULL,
  `Priority` int(11) NOT NULL,
  `Selected` smallint(1) NOT NULL,
  `SelectDateTime` datetime NOT NULL,
  `Ready` smallint(1) NOT NULL,
  `Triggered` int(11) NOT NULL,
  `Status` varchar(1) NOT NULL,
  `Done` smallint(1) NOT NULL,
  `NextMsgID` int(11) NOT NULL,
  `LastMsgID` int(10) unsigned NOT NULL,
  `Count` int(10) unsigned NOT NULL,
  `CountStyle` int(11) NOT NULL,
  `CountSys` int(11) NOT NULL,
  `NumMsgs` int(11) NOT NULL,
  `LastPlayed` datetime NOT NULL,
  `SecondsToNextPlay` int(11) NOT NULL,
  `PlayAll` int(11) NOT NULL,
  `StateMachine1` varchar(15) NOT NULL,
  `StateMachine2` varchar(15) NOT NULL,
  `Request_Behavior` int(11) NOT NULL,
  `Behavior_StyleID` int(11) NOT NULL,
  `Behavior_Input` int(11) NOT NULL,
  `Behavior_Result` int(11) NOT NULL,
  `Behavior_Status` varchar(15) NOT NULL,
  PRIMARY KEY (`StyleID`,`GroupID`,`DeviceID`,`UserID`),
  UNIQUE KEY `StyleID` (`StyleID`,`GroupID`,`DeviceID`,`UserID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `stylestatus`
--

INSERT INTO `stylestatus` (`StyleID`, `GroupID`, `DeviceID`, `UserID`, `StyleType`, `Version`, `Priority`, `Selected`, `SelectDateTime`, `Ready`, `Triggered`, `Status`, `Done`, `NextMsgID`, `LastMsgID`, `Count`, `CountStyle`, `CountSys`, `NumMsgs`, `LastPlayed`, `SecondsToNextPlay`, `PlayAll`, `StateMachine1`, `StateMachine2`, `Request_Behavior`, `Behavior_StyleID`, `Behavior_Input`, `Behavior_Result`, `Behavior_Status`) VALUES
(1020, 28, 0, 0, 'STICKY', 0, 0, 0, '0000-00-00 00:00:00', 0, 0, '0', 0, 0, 0, 0, 0, 0, 0, '0000-00-00 00:00:00', 0, 0, '0', '0', 0, 0, 0, 0, '0'),
(1020, 28, 0, 28, 'STICKY', 0, 0, 1, '2017-05-02 20:49:35', 0, 0, '0', 0, 0, 0, 8, 4, 4, 4, '0000-00-00 00:00:00', 0, 0, '0', '0', 0, 0, 0, 0, '0'),
(1025, 28, 0, 0, 'FUNFACT', 0, 0, 0, '0000-00-00 00:00:00', 0, 0, '0', 0, 0, 0, 0, 0, 0, 0, '0000-00-00 00:00:00', 0, 0, '0', '0', 0, 0, 0, 0, '0'),
(1025, 28, 0, 28, 'FUNFACT', 0, 0, 0, '0000-00-00 00:00:00', 0, 0, '0', 0, 0, 0, 0, 0, 0, 0, '0000-00-00 00:00:00', 0, 0, '0', '0', 0, 0, 0, 0, '0');

-- --------------------------------------------------------

--
-- Table structure for table `sysmsglist`
--

CREATE TABLE IF NOT EXISTS `sysmsglist` (
  `SysMsgListID` int(11) unsigned NOT NULL,
  `SysMsgID` int(11) unsigned NOT NULL,
  `SysGrpID` int(11) unsigned NOT NULL,
  `SysEnablerID` int(11) unsigned NOT NULL,
  `SysGenType` varchar(15) NOT NULL COMMENT 'How message is derived.',
  `GrpMsgID` int(10) unsigned NOT NULL,
  `GrpGrpID` int(10) unsigned NOT NULL,
  `GrpEnablerID` int(10) unsigned NOT NULL,
  `GrpActiveMsgID` int(10) unsigned NOT NULL,
  `MsgStyleName` text CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`SysMsgListID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `sysmsglist`
--

INSERT INTO `sysmsglist` (`SysMsgListID`, `SysMsgID`, `SysGrpID`, `SysEnablerID`, `SysGenType`, `GrpMsgID`, `GrpGrpID`, `GrpEnablerID`, `GrpActiveMsgID`, `MsgStyleName`) VALUES
(1, 1, 1, 1, 'Substitute', 0, 0, 0, 0, 'STICKY_HEADER'),
(2, 3, 1, 1, 'Substitute', 0, 0, 0, 0, 'STICKY_END'),
(3, 2, 1, 1, 'Substitute', 0, 0, 0, 0, 'STICKY_NEXT'),
(4, 4, 1, 1, 'ByDate_Random', 0, 0, 0, 0, 'FUNFACT'),
(55, 1, 1, 1, 'Substitute', 426, 28, 303, 373, 'STICKY_HEADER'),
(56, 2, 1, 1, 'Substitute', 427, 28, 304, 374, 'STICKY_NEXT');

-- --------------------------------------------------------

--
-- Table structure for table `triggerlist`
--

CREATE TABLE IF NOT EXISTS `triggerlist` (
  `TriggerListID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique Identifier For Trigger List Table',
  `TriggerID` int(10) unsigned NOT NULL COMMENT 'Reference into the Triggers Table for a unique Trigger Type',
  `EnablerID` int(10) unsigned NOT NULL COMMENT 'Associates this trigger event type to an Enabler Table entry',
  `GroupID` int(11) NOT NULL,
  PRIMARY KEY (`TriggerListID`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

--
-- Dumping data for table `triggerlist`
--

INSERT INTO `triggerlist` (`TriggerListID`, `TriggerID`, `EnablerID`, `GroupID`) VALUES
(1, 1, 10, 28);

-- --------------------------------------------------------

--
-- Table structure for table `triggers`
--

CREATE TABLE IF NOT EXISTS `triggers` (
  `TriggerID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `TriggerShortName` text NOT NULL,
  `TriggerLongName` text NOT NULL,
  `TriggerDescription` text NOT NULL,
  PRIMARY KEY (`TriggerID`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;

--
-- Dumping data for table `triggers`
--

INSERT INTO `triggers` (`TriggerID`, `TriggerShortName`, `TriggerLongName`, `TriggerDescription`) VALUES
(1, 'MouseMovement', 'Mouse Movement', 'The user has dragged their mouse to a different location on the screen.'),
(2, 'KeyboardEntry', 'Keyboard Entry', 'The user has pressed a key on thier keyboard.'),
(3, 'MotionDetected', 'Motion Detected Near Device', 'The user has moved near the device.'),
(4, 'STICKY_PLAY', 'Play STICKIES', 'Play all the sticky messages'),
(5, 'USER_PRESENT', 'User Present', 'User Presence has been detected.'),
(6, 'USER_ABSENT', 'User Absence', 'User is no longer detected in presence of device.');

-- --------------------------------------------------------

--
-- Table structure for table `userconfig`
--

CREATE TABLE IF NOT EXISTS `userconfig` (
  `GroupID` int(11) NOT NULL,
  `UserID` int(11) NOT NULL,
  `Gender` varchar(6) NOT NULL,
  `TimeZone` varchar(3) NOT NULL,
  `RoomNumber` text NOT NULL,
  `Floor` text NOT NULL,
  `UserGroup` text NOT NULL,
  `WakeTime` datetime NOT NULL,
  `BedTime` datetime NOT NULL,
  `Persistance` text NOT NULL,
  `Verboseness` text NOT NULL,
  `Assertiveness` text NOT NULL,
  `ConfirmUser` text NOT NULL,
  `AutoSpeak` text NOT NULL,
  `Distance` text NOT NULL,
  `AudioLevel` text NOT NULL,
  `SplitScreen` text NOT NULL,
  `VoiceDetection` text NOT NULL,
  `AvatarGender` text NOT NULL,
  `AvatarName` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

