--
-- Host: localhost    Database: zigsbys8_calls
-- ------------------------------------------------------


--
-- Current Database: `zigsbys8_calls`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `zigsbys8_calls` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `zigsbys8_calls`;

--
-- Table structure for table `annotation_types`
--

CREATE TABLE `annotation_types` (
  `id` tinyint(4) NOT NULL AUTO_INCREMENT,
  `description` varchar(32) NOT NULL,
  `tenant_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `tenant_id` (`tenant_id`),
  CONSTRAINT `annotation_types_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `annotation_types`
--

INSERT INTO `annotation_types` VALUES (1,'called',1),(2,'read',1),(3,'noted',1),(4,'changed',1),(5,'labeled',1),(6,'sms',1);

--
-- Table structure for table `annotations`
--

CREATE TABLE `annotations` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `annotation_type` tinyint(4) NOT NULL,
  `message_id` bigint(20) NOT NULL,
  `user_id` int(11) NOT NULL,
  `description` text CHARACTER SET latin1 NOT NULL,
  `created` datetime NOT NULL,
  `tenant_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `annotation_type_message_id` (`annotation_type`,`message_id`,`created`),
  KEY `created` (`created`),
  KEY `tenant_id` (`tenant_id`),
  CONSTRAINT `annotations_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `annotations`
--


--
-- Table structure for table `audio_files`
--

CREATE TABLE `audio_files` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `label` varchar(255) DEFAULT NULL,
  `user_id` int(11) NOT NULL,
  `url` varchar(255) DEFAULT NULL,
  `recording_call_sid` varchar(100) DEFAULT NULL,
  `tag` varchar(100) DEFAULT NULL,
  `cancelled` tinyint(4) DEFAULT '0',
  `created` datetime DEFAULT NULL,
  `updated` datetime DEFAULT NULL,
  `tenant_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `url` (`url`),
  KEY `recording_call_sid` (`recording_call_sid`),
  KEY `tag` (`tag`),
  KEY `tenant_id` (`tenant_id`),
  CONSTRAINT `audio_files_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `audio_files`
--

INSERT INTO `audio_files` VALUES (1,'Upload of 32bad73cc60a8d8194b61585cf7d26a2.mp3',1,'vbx-audio-upload://2497d091c08b45251e76d3782719d883.mp3',NULL,'global',0,'2012-07-03 08:57:46','2012-07-03 08:57:46',1),(2,'Upload of 32bad73cc60a8d8194b61585cf7d26a2.mp3',1,'vbx-audio-upload://eaaad2bc8a093b597bd6465d99f12cc5.mp3',NULL,'global',0,'2012-07-03 08:58:42','2012-07-03 08:58:42',1),(3,'Upload of cdeca44f9e0a32b64854fd7c3fc4dbad.mp3',1,'vbx-audio-upload://ef8afa3542083aaadbfd32711354bba0.mp3',NULL,'global',0,'2012-07-03 09:00:38','2012-07-03 09:00:38',1),(4,'Upload of cdeca44f9e0a32b64854fd7c3fc4dbad.mp3',1,'vbx-audio-upload://0a2dea294836f5ef91fdfd5b7819730b.mp3',NULL,'global',0,'2012-07-03 09:01:53','2012-07-03 09:01:53',1),(5,'Upload of acd619c61679b6c56ead06d9149d8678.mp3',1,'vbx-audio-upload://d743fde70f26ba1d07fed4e03f37a46b.mp3',NULL,'global',0,'2012-07-03 09:03:12','2012-07-03 09:03:12',1),(6,'Upload of cdeca44f9e0a32b64854fd7c3fc4dbad.mp3',1,'vbx-audio-upload://8eac379275116592a72c3d449c9f83bd.mp3',NULL,'global',0,'2012-07-03 09:04:54','2012-07-03 09:04:54',1),(7,'Upload of cdeca44f9e0a32b64854fd7c3fc4dbad.mp3',1,'vbx-audio-upload://4ca9e60c1a90bea270921b1413502a94.mp3',NULL,'global',0,'2012-07-03 09:05:13','2012-07-03 09:05:13',1);

--
-- Table structure for table `auth_types`
--

CREATE TABLE `auth_types` (
  `id` tinyint(4) NOT NULL AUTO_INCREMENT,
  `description` varchar(255) NOT NULL,
  `tenant_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `tenant_id` (`tenant_id`),
  CONSTRAINT `auth_types_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `auth_types`
--

INSERT INTO `auth_types` VALUES (1,'openvbx',1),(2,'google',1);

--
-- Table structure for table `cache`
--

CREATE TABLE `cache` (
  `key` varchar(255) NOT NULL DEFAULT '',
  `group` varchar(255) NOT NULL DEFAULT '',
  `value` text NOT NULL,
  `tenant_id` int(11) NOT NULL,
  PRIMARY KEY (`key`(80),`group`(80),`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cache`
--

INSERT INTO `cache` VALUES ('account-type','VBX_Accounts','a:2:{s:4:\"data\";s:4:\"Full\";s:7:\"expires\";i:1341323206;}',1),('countries','VBX_Incoming_numbers','a:2:{s:4:\"data\";a:13:{s:2:\"AT\";O:8:\"stdClass\":6:{s:12:\"country_code\";s:2:\"AT\";s:7:\"country\";s:7:\"Austria\";s:3:\"uri\";s:85:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/AT.json\";s:16:\"subresource_uris\";O:8:\"stdClass\":2:{s:5:\"local\";s:91:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/AT/Local.json\";s:9:\"toll_free\";s:94:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/AT/TollFree.json\";}s:4:\"code\";s:2:\"43\";s:6:\"search\";s:7:\"+43 (*)\";}s:2:\"BE\";O:8:\"stdClass\":6:{s:12:\"country_code\";s:2:\"BE\";s:7:\"country\";s:7:\"Belgium\";s:3:\"uri\";s:85:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/BE.json\";s:16:\"subresource_uris\";O:8:\"stdClass\":2:{s:5:\"local\";s:91:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/BE/Local.json\";s:9:\"toll_free\";s:94:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/BE/TollFree.json\";}s:4:\"code\";s:2:\"32\";s:6:\"search\";s:7:\"+32 (*)\";}s:2:\"CA\";O:8:\"stdClass\":6:{s:12:\"country_code\";s:2:\"CA\";s:7:\"country\";s:6:\"Canada\";s:3:\"uri\";s:85:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/CA.json\";s:16:\"subresource_uris\";O:8:\"stdClass\":2:{s:5:\"local\";s:91:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/CA/Local.json\";s:9:\"toll_free\";s:94:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/CA/TollFree.json\";}s:4:\"code\";s:1:\"1\";s:6:\"search\";s:6:\"+1 (*)\";}s:2:\"DK\";O:8:\"stdClass\":6:{s:12:\"country_code\";s:2:\"DK\";s:7:\"country\";s:7:\"Denmark\";s:3:\"uri\";s:85:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/DK.json\";s:16:\"subresource_uris\";O:8:\"stdClass\":2:{s:5:\"local\";s:91:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/DK/Local.json\";s:9:\"toll_free\";s:94:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/DK/TollFree.json\";}s:4:\"code\";s:2:\"45\";s:6:\"search\";s:7:\"+45 (*)\";}s:2:\"FI\";O:8:\"stdClass\":6:{s:12:\"country_code\";s:2:\"FI\";s:7:\"country\";s:7:\"Finland\";s:3:\"uri\";s:85:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/FI.json\";s:16:\"subresource_uris\";O:8:\"stdClass\":2:{s:5:\"local\";s:91:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/FI/Local.json\";s:9:\"toll_free\";s:94:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/FI/TollFree.json\";}s:4:\"code\";s:3:\"358\";s:6:\"search\";s:8:\"+358 (*)\";}s:2:\"FR\";O:8:\"stdClass\":6:{s:12:\"country_code\";s:2:\"FR\";s:7:\"country\";s:6:\"France\";s:3:\"uri\";s:85:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/FR.json\";s:16:\"subresource_uris\";O:8:\"stdClass\":2:{s:5:\"local\";s:91:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/FR/Local.json\";s:9:\"toll_free\";s:94:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/FR/TollFree.json\";}s:4:\"code\";s:2:\"33\";s:6:\"search\";s:7:\"+33 (*)\";}s:2:\"GB\";O:8:\"stdClass\":6:{s:12:\"country_code\";s:2:\"GB\";s:7:\"country\";s:14:\"United Kingdom\";s:3:\"uri\";s:85:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/GB.json\";s:16:\"subresource_uris\";O:8:\"stdClass\":2:{s:5:\"local\";s:91:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/GB/Local.json\";s:9:\"toll_free\";s:94:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/GB/TollFree.json\";}s:4:\"code\";s:2:\"44\";s:6:\"search\";s:7:\"+44 (*)\";}s:2:\"IE\";O:8:\"stdClass\":6:{s:12:\"country_code\";s:2:\"IE\";s:7:\"country\";s:7:\"Ireland\";s:3:\"uri\";s:85:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/IE.json\";s:16:\"subresource_uris\";O:8:\"stdClass\":2:{s:5:\"local\";s:91:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/IE/Local.json\";s:9:\"toll_free\";s:94:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/IE/TollFree.json\";}s:4:\"code\";s:3:\"353\";s:6:\"search\";s:8:\"+353 (*)\";}s:2:\"IT\";O:8:\"stdClass\":6:{s:12:\"country_code\";s:2:\"IT\";s:7:\"country\";s:5:\"Italy\";s:3:\"uri\";s:85:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/IT.json\";s:16:\"subresource_uris\";O:8:\"stdClass\":2:{s:5:\"local\";s:91:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/IT/Local.json\";s:9:\"toll_free\";s:94:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/IT/TollFree.json\";}s:4:\"code\";s:2:\"39\";s:6:\"search\";s:7:\"+39 (*)\";}s:2:\"NL\";O:8:\"stdClass\":6:{s:12:\"country_code\";s:2:\"NL\";s:7:\"country\";s:11:\"Netherlands\";s:3:\"uri\";s:85:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/NL.json\";s:16:\"subresource_uris\";O:8:\"stdClass\":2:{s:5:\"local\";s:91:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/NL/Local.json\";s:9:\"toll_free\";s:94:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/NL/TollFree.json\";}s:4:\"code\";s:2:\"31\";s:6:\"search\";s:7:\"+31 (*)\";}s:2:\"PL\";O:8:\"stdClass\":6:{s:12:\"country_code\";s:2:\"PL\";s:7:\"country\";s:6:\"Poland\";s:3:\"uri\";s:85:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/PL.json\";s:16:\"subresource_uris\";O:8:\"stdClass\":2:{s:5:\"local\";s:91:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/PL/Local.json\";s:9:\"toll_free\";s:94:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/PL/TollFree.json\";}s:4:\"code\";s:2:\"48\";s:6:\"search\";s:7:\"+48 (*)\";}s:2:\"SE\";O:8:\"stdClass\":6:{s:12:\"country_code\";s:2:\"SE\";s:7:\"country\";s:6:\"Sweden\";s:3:\"uri\";s:85:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/SE.json\";s:16:\"subresource_uris\";O:8:\"stdClass\":2:{s:5:\"local\";s:91:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/SE/Local.json\";s:9:\"toll_free\";s:94:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/SE/TollFree.json\";}s:4:\"code\";s:2:\"46\";s:6:\"search\";s:7:\"+46 (*)\";}s:2:\"US\";O:8:\"stdClass\":6:{s:12:\"country_code\";s:2:\"US\";s:7:\"country\";s:13:\"United States\";s:3:\"uri\";s:85:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/US.json\";s:16:\"subresource_uris\";O:8:\"stdClass\":2:{s:5:\"local\";s:91:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/US/Local.json\";s:9:\"toll_free\";s:94:\"/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/AvailablePhoneNumbers/US/TollFree.json\";}s:4:\"code\";s:1:\"1\";s:6:\"search\";s:6:\"+1 (*)\";}}s:7:\"expires\";i:1341324631;}',1),('incoming-numbers','VBX_Incoming_numbers','a:2:{s:4:\"data\";a:7:{i:0;O:8:\"stdClass\":14:{s:7:\"flow_id\";i:1;s:2:\"id\";s:34:\"PN14f1ed9b21b51757b19947ca47f44d23\";s:4:\"name\";s:16:\"Zigsby\'s Kitchen\";s:5:\"phone\";s:14:\"(877) 792-9310\";s:12:\"phone_number\";s:12:\"+18777929310\";s:3:\"pin\";N;s:7:\"sandbox\";b:0;s:3:\"url\";s:51:\"http://zigsbyskitchen.com/calls/twiml/start/voice/1\";s:6:\"method\";s:4:\"POST\";s:6:\"smsUrl\";s:49:\"http://zigsbyskitchen.com/calls/twiml/start/sms/1\";s:9:\"smsMethod\";s:4:\"POST\";s:12:\"capabilities\";O:8:\"stdClass\":2:{s:5:\"voice\";b:1;s:3:\"sms\";b:0;}s:19:\"voiceApplicationSid\";s:0:\"\";s:9:\"installed\";b:1;}i:1;O:8:\"stdClass\":14:{s:7:\"flow_id\";i:1;s:2:\"id\";s:34:\"PN1f5fc4ee9f0a9506331699afd19f8234\";s:4:\"name\";s:22:\"Zigsby\'s Kitchen Local\";s:5:\"phone\";s:14:\"(704) 781-8602\";s:12:\"phone_number\";s:12:\"+17047818602\";s:3:\"pin\";N;s:7:\"sandbox\";b:0;s:3:\"url\";s:51:\"http://zigsbyskitchen.com/calls/twiml/start/voice/1\";s:6:\"method\";s:4:\"POST\";s:6:\"smsUrl\";s:49:\"http://zigsbyskitchen.com/calls/twiml/start/sms/1\";s:9:\"smsMethod\";s:4:\"POST\";s:12:\"capabilities\";O:8:\"stdClass\":2:{s:5:\"voice\";b:1;s:3:\"sms\";b:1;}s:19:\"voiceApplicationSid\";s:0:\"\";s:9:\"installed\";b:1;}i:2;O:8:\"stdClass\":14:{s:7:\"flow_id\";N;s:2:\"id\";s:34:\"PNfc0a67035d32837b7941b490326a0563\";s:4:\"name\";s:12:\"Chris Carter\";s:5:\"phone\";s:14:\"(704) 419-8501\";s:12:\"phone_number\";s:12:\"+17044198501\";s:3:\"pin\";N;s:7:\"sandbox\";b:0;s:3:\"url\";s:52:\"http://chriscartersite.com/calls/twiml/start/voice/1\";s:6:\"method\";s:4:\"POST\";s:6:\"smsUrl\";s:50:\"http://chriscartersite.com/calls/twiml/start/sms/1\";s:9:\"smsMethod\";s:4:\"POST\";s:12:\"capabilities\";O:8:\"stdClass\":2:{s:5:\"voice\";b:1;s:3:\"sms\";b:1;}s:19:\"voiceApplicationSid\";s:0:\"\";s:9:\"installed\";b:0;}i:3;O:8:\"stdClass\":14:{s:7:\"flow_id\";N;s:2:\"id\";s:34:\"PN47a1a2f1c2a0fd4cb636b10629842255\";s:4:\"name\";s:12:\"C-Tech-I Net\";s:5:\"phone\";s:14:\"(888) 814-5521\";s:12:\"phone_number\";s:12:\"+18888145521\";s:3:\"pin\";N;s:7:\"sandbox\";b:0;s:3:\"url\";s:45:\"http://ctechi.net/OpenVBX/twiml/start/voice/1\";s:6:\"method\";s:4:\"POST\";s:6:\"smsUrl\";s:0:\"\";s:9:\"smsMethod\";s:4:\"POST\";s:12:\"capabilities\";O:8:\"stdClass\":2:{s:5:\"voice\";b:1;s:3:\"sms\";b:0;}s:19:\"voiceApplicationSid\";s:0:\"\";s:9:\"installed\";b:0;}i:4;O:8:\"stdClass\":14:{s:7:\"flow_id\";N;s:2:\"id\";s:34:\"PN5bf062202e294b9e9f504d4fe6f6f963\";s:4:\"name\";s:10:\"Kitchens A\";s:5:\"phone\";s:14:\"(877) 298-7117\";s:12:\"phone_number\";s:12:\"+18772987117\";s:3:\"pin\";N;s:7:\"sandbox\";b:0;s:3:\"url\";s:35:\"http://demo.twilio.com/welcome/call\";s:6:\"method\";s:4:\"POST\";s:6:\"smsUrl\";s:34:\"http://demo.twilio.com/welcome/sms\";s:9:\"smsMethod\";s:4:\"POST\";s:12:\"capabilities\";O:8:\"stdClass\":2:{s:5:\"voice\";b:1;s:3:\"sms\";b:0;}s:19:\"voiceApplicationSid\";s:0:\"\";s:9:\"installed\";b:0;}i:5;O:8:\"stdClass\":14:{s:7:\"flow_id\";N;s:2:\"id\";s:34:\"PNa8b9a50bb65213569949b16c1513a9e5\";s:4:\"name\";s:21:\"Clean Line Chameleons\";s:5:\"phone\";s:14:\"(704) 209-9320\";s:12:\"phone_number\";s:12:\"+17042099320\";s:3:\"pin\";N;s:7:\"sandbox\";b:0;s:3:\"url\";s:58:\"http://cleanlinechameleons.com/OpenVBX/twiml/start/voice/2\";s:6:\"method\";s:4:\"POST\";s:6:\"smsUrl\";s:0:\"\";s:9:\"smsMethod\";s:4:\"POST\";s:12:\"capabilities\";O:8:\"stdClass\":2:{s:5:\"voice\";b:1;s:3:\"sms\";b:1;}s:19:\"voiceApplicationSid\";N;s:9:\"installed\";b:0;}i:6;O:8:\"stdClass\":14:{s:7:\"flow_id\";N;s:2:\"id\";s:7:\"Sandbox\";s:4:\"name\";N;s:5:\"phone\";s:14:\"(415) 599-2671\";s:12:\"phone_number\";s:12:\"+14155992671\";s:3:\"pin\";s:8:\"16027267\";s:7:\"sandbox\";b:1;s:3:\"url\";s:36:\"http://demo.twilio.com/welcome/voice\";s:6:\"method\";s:4:\"POST\";s:6:\"smsUrl\";s:34:\"http://demo.twilio.com/welcome/sms\";s:9:\"smsMethod\";s:4:\"POST\";s:12:\"capabilities\";N;s:19:\"voiceApplicationSid\";N;s:9:\"installed\";b:0;}}s:7:\"expires\";i:1342011837;}',1),('sandbox','VBX_Incoming_numbers','a:2:{s:4:\"data\";O:8:\"stdClass\":14:{s:7:\"flow_id\";N;s:2:\"id\";s:7:\"Sandbox\";s:4:\"name\";N;s:5:\"phone\";s:14:\"(415) 599-2671\";s:12:\"phone_number\";s:12:\"+14155992671\";s:3:\"pin\";s:8:\"16027267\";s:7:\"sandbox\";b:1;s:3:\"url\";s:36:\"http://demo.twilio.com/welcome/voice\";s:6:\"method\";s:4:\"POST\";s:6:\"smsUrl\";s:34:\"http://demo.twilio.com/welcome/sms\";s:9:\"smsMethod\";s:4:\"POST\";s:12:\"capabilities\";N;s:19:\"voiceApplicationSid\";N;s:9:\"installed\";b:0;}s:7:\"expires\";i:1342011837;}',1);

--
-- Table structure for table `flow_store`
--

CREATE TABLE `flow_store` (
  `key` varchar(255) NOT NULL,
  `value` text,
  `flow_id` int(11) NOT NULL,
  `tenant_id` bigint(20) NOT NULL,
  UNIQUE KEY `key_flow` (`key`,`flow_id`),
  KEY `key` (`key`,`flow_id`),
  KEY `tenant_id` (`tenant_id`),
  CONSTRAINT `flow_store_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `flow_store`
--


--
-- Table structure for table `flows`
--

CREATE TABLE `flows` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `user_id` int(11) NOT NULL,
  `created` datetime DEFAULT NULL,
  `updated` datetime DEFAULT NULL,
  `data` text,
  `sms_data` text,
  `tenant_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`,`tenant_id`),
  KEY `user_id` (`user_id`),
  KEY `tenant_id` (`tenant_id`),
  CONSTRAINT `flows_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `flows_ibfk_2` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `flows`
--

INSERT INTO `flows` VALUES (1,'Zigsby\'s Kitchen',1,NULL,NULL,'{\"245655\":{\"name\":\"Greeting\",\"data\":{\"prompt_say\":\"\",\"prompt_play\":\"vbx-audio-upload://2497d091c08b45251e76d3782719d883.mp3\",\"prompt_mode\":\"play\",\"prompt_tag\":\"global\",\"prompt_caller_id\":\"+17047818602\",\"number\":\"\",\"library\":\"\",\"next\":\"start/245655/bb84f7\"},\"id\":\"245655\",\"type\":\"standard---greeting\"},\"275914\":{\"name\":\"Dial\",\"data\":{\"dial-whom-selector\":\"user-or-group\",\"dial-whom-user-or-group_id\":\"2\",\"dial-whom-user-or-group_type\":\"group\",\"dial-whom-number\":\"\",\"callerId\":\"+17047818602\",\"dial-whisper\":\"1\",\"no-answer-group-voicemail_say\":\"\",\"no-answer-group-voicemail_play\":\"vbx-audio-upload://ef8afa3542083aaadbfd32711354bba0.mp3\",\"no-answer-group-voicemail_mode\":\"play\",\"no-answer-group-voicemail_tag\":\"global\",\"no-answer-group-voicemail_caller_id\":\"+17047818602\",\"number\":\"\",\"library\":\"\",\"no-answer-action\":\"redirect\",\"no-answer-redirect\":\"start/cce8e4/275914/e63798\",\"no-answer-redirect-number\":\"\",\"version\":\"3\"},\"id\":\"275914\",\"type\":\"standard---dial\"},\"bb84f7\":{\"name\":\"Menu\",\"data\":{\"prompt_say\":\"\",\"prompt_play\":\"\",\"prompt_mode\":\"\",\"prompt_tag\":\"global\",\"prompt_caller_id\":\"+17047818602\",\"number\":[\"\",\"\"],\"library\":[\"\",\"\"],\"keys[]\":[\"1\",\"2\"],\"choices[]\":[\"\",\"\"],\"repeat-count\":\"\",\"next\":\"\",\"invalid-option_say\":\"\",\"invalid-option_play\":\"\",\"invalid-option_mode\":\"\",\"invalid-option_tag\":\"global\",\"invalid-option_caller_id\":\"+17047818602\"},\"id\":\"bb84f7\",\"type\":\"menu---menu\"},\"start\":{\"name\":\"Call Start\",\"data\":{\"next\":\"start/cce8e4\"},\"id\":\"start\",\"type\":\"standard---start\"},\"cce8e4\":{\"name\":\"Menu\",\"data\":{\"prompt_say\":\"\",\"prompt_play\":\"vbx-audio-upload://eaaad2bc8a093b597bd6465d99f12cc5.mp3\",\"prompt_mode\":\"play\",\"prompt_tag\":\"global\",\"prompt_caller_id\":\"+17047818602\",\"number\":[\"\",\"\"],\"library\":[\"\",\"\"],\"keys[]\":[\"1\",\"2\"],\"choices[]\":[\"start/cce8e4/480bca\",\"start/cce8e4/275914\"],\"repeat-count\":\"\",\"next\":\"\",\"invalid-option_say\":\"\",\"invalid-option_play\":\"\",\"invalid-option_mode\":\"\",\"invalid-option_tag\":\"global\",\"invalid-option_caller_id\":\"+17047818602\"},\"id\":\"cce8e4\",\"type\":\"menu---menu\"},\"480bca\":{\"name\":\"Dial\",\"data\":{\"dial-whom-selector\":\"user-or-group\",\"dial-whom-user-or-group_id\":\"1\",\"dial-whom-user-or-group_type\":\"group\",\"dial-whom-number\":\"\",\"callerId\":\"+17047818602\",\"dial-whisper\":\"1\",\"no-answer-group-voicemail_say\":\"\",\"no-answer-group-voicemail_play\":\"vbx-audio-upload://8eac379275116592a72c3d449c9f83bd.mp3\",\"no-answer-group-voicemail_mode\":\"play\",\"no-answer-group-voicemail_tag\":\"global\",\"no-answer-group-voicemail_caller_id\":\"+17047818602\",\"number\":\"\",\"library\":\"\",\"no-answer-action\":\"redirect\",\"no-answer-redirect\":\"start/cce8e4/480bca/22f071\",\"no-answer-redirect-number\":\"\",\"version\":\"3\"},\"id\":\"480bca\",\"type\":\"standard---dial\"},\"e63798\":{\"name\":\"Voicemail\",\"data\":{\"prompt_say\":\"\",\"prompt_play\":\"vbx-audio-upload://d743fde70f26ba1d07fed4e03f37a46b.mp3\",\"prompt_mode\":\"play\",\"prompt_tag\":\"global\",\"prompt_caller_id\":\"+17047818602\",\"number\":\"\",\"library\":\"\",\"permissions_id\":\"2\",\"permissions_type\":\"group\"},\"id\":\"e63798\",\"type\":\"standard---voicemail\"},\"22f071\":{\"name\":\"Voicemail\",\"data\":{\"prompt_say\":\"\",\"prompt_play\":\"vbx-audio-upload://4ca9e60c1a90bea270921b1413502a94.mp3\",\"prompt_mode\":\"play\",\"prompt_tag\":\"global\",\"prompt_caller_id\":\"+17047818602\",\"number\":\"\",\"library\":\"\",\"permissions_id\":\"1\",\"permissions_type\":\"group\"},\"id\":\"22f071\",\"type\":\"standard---voicemail\"}}',NULL,1),(2,'Zigsby\'s Kitchen Toll Free',1,NULL,NULL,NULL,NULL,1);

--
-- Table structure for table `group_annotations`
--

CREATE TABLE `group_annotations` (
  `group_id` int(11) NOT NULL,
  `annotation_id` bigint(20) NOT NULL,
  `tenant_id` bigint(20) NOT NULL,
  PRIMARY KEY (`group_id`,`annotation_id`),
  KEY `tenant_id` (`tenant_id`),
  CONSTRAINT `group_annotations_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `group_annotations`
--


--
-- Table structure for table `group_messages`
--

CREATE TABLE `group_messages` (
  `group_id` int(11) NOT NULL,
  `message_id` int(11) NOT NULL,
  `tenant_id` bigint(20) NOT NULL,
  PRIMARY KEY (`group_id`,`message_id`),
  KEY `tenant_id` (`tenant_id`),
  KEY `message_id` (`message_id`),
  CONSTRAINT `group_messages_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`),
  CONSTRAINT `group_messages_ibfk_2` FOREIGN KEY (`message_id`) REFERENCES `messages` (`id`),
  CONSTRAINT `group_messages_ibfk_3` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `group_messages`
--

INSERT INTO `group_messages` VALUES (1,1,1),(1,2,1),(1,3,1),(1,4,1),(1,5,1),(1,6,1),(1,7,1),(1,8,1),(1,9,1),(1,10,1);

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

CREATE TABLE `groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) DEFAULT NULL,
  `is_active` tinyint(4) NOT NULL DEFAULT '1',
  `tenant_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `tenant_id` (`tenant_id`),
  CONSTRAINT `groups_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

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

INSERT INTO `groups` VALUES (1,'Sales',1,1),(2,'Accounting',1,1);

--
-- Table structure for table `groups_users`
--

CREATE TABLE `groups_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `group_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `tenant_id` bigint(20) NOT NULL,
  `order` tinyint(3) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `group_id` (`group_id`),
  KEY `tenant_id` (`tenant_id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `groups_users_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `groups_users_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`),
  CONSTRAINT `groups_users_ibfk_3` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `groups_users`
--

INSERT INTO `groups_users` VALUES (1,1,1,1,1),(2,2,1,1,1),(3,1,2,1,2),(4,2,2,1,2),(5,1,2,1,3),(6,2,2,1,3);

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

CREATE TABLE `messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created` datetime DEFAULT NULL,
  `updated` datetime DEFAULT NULL,
  `read` datetime DEFAULT NULL,
  `call_sid` varchar(40) DEFAULT NULL,
  `caller` varchar(20) DEFAULT NULL,
  `called` varchar(20) DEFAULT NULL,
  `type` varchar(10) DEFAULT NULL,
  `status` varchar(10) DEFAULT NULL,
  `content_url` varchar(255) DEFAULT NULL,
  `content_text` varchar(5000) DEFAULT NULL,
  `notes` varchar(5000) DEFAULT NULL,
  `size` smallint(6) DEFAULT NULL,
  `assigned_to` bigint(20) DEFAULT NULL,
  `archived` tinyint(4) NOT NULL DEFAULT '0',
  `ticket_status` enum('open','closed','pending') NOT NULL DEFAULT 'open',
  `tenant_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `call_sid` (`call_sid`),
  KEY `tenant_id` (`tenant_id`),
  CONSTRAINT `messages_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;

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

INSERT INTO `messages` VALUES (1,'2012-07-03 14:02:47','2012-07-03 14:02:55',NULL,'CA3c6c0c8f8e4188afa80224d513301f8f','+17043156215','+18777929310','voice','new','http://api.twilio.com/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/Recordings/RE2d9f96590bda71a07897376fe4325d4e','This is a test message this is a test message thank you.','',8,NULL,0,'open',1),(2,'2012-07-03 14:04:06','2012-07-03 14:04:09',NULL,'CA246b50b10c04fca170ce30d1995096d2','+16039262578','+18777929310','voice','new','http://api.twilio.com/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/Recordings/RE77740ef46fab68f06bc51361173ba458','(blank)','',5,NULL,0,'open',1),(3,'2012-07-05 20:20:45','2012-07-05 20:20:45',NULL,'CA523ae735dc6a567e681dc1785fe90421','+19024317991','+18777929310','voice','new','http://api.twilio.com/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/Recordings/RE5f2b6abeca9ffd59b7a94bd670cd22aa','(blank)','',3,NULL,0,'open',1),(4,'2012-07-06 15:18:46','2012-07-06 15:19:14',NULL,'CA59c903b72b517eb410e18a01bf3416e3','+12026159669','+18777929310','voice','new','http://api.twilio.com/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/Recordings/RE1d2f37aab3aaa3906d4f10a9f219f3ec','Hi my name is so loop ... hello e. d. I called earlier this week about ... said it return for a sink and I was just waiting for the shipping label I haven\'t received it ... yet so if you could ... email that to me my email address is sol s. a. u. l. and then my last name lowe l. o. e. b. at g. mail dot com ... or give me a call at (202) 615-9669 ... so I can said to say on back to you guys thank you very much bye.','',33,NULL,0,'open',1),(5,'2012-07-06 20:45:15','2012-07-06 20:45:33',NULL,'CA286077a28878dd0506e9d9be78a151a7','+15745271969','+18777929310','voice','new','http://api.twilio.com/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/Recordings/RE6489a55c4f4d99cdff2be41a89988279','Hello I\'m trying to locate a tight for s. 990 over mount kitchen sink ... if you could if you have 1 of those are could locate 1 of those please call me ... my number is area code (574) 527-1969 my name is peggy thank.','',26,NULL,0,'open',1),(6,'2012-07-07 13:00:08','2012-07-07 13:00:48',NULL,'CA8b5a1bcaff6e9cdb0896676484bfb451','+12078315203','+18777929310','voice','new','http://api.twilio.com/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/Recordings/REe8050573100b9af7884931d9db75415f','... hi this is lisa porter (207) 831-5203 hi wanna confirm ... that our kraus ... hello kitchen faucet has been shipped out ... we did receive the sink with order number 100000342 and I got a call from chris saying that the ... kitchen faucet would be ... and as of last week and ... that would get shipped out directly to cross number k. p. f. 211 ... I believe ... with so just under we have been charged for please call me at (207) 831-5203 thank.','',57,NULL,0,'open',1),(7,'2012-07-09 22:57:23','2012-07-09 22:57:46',NULL,'CAa7d1a08680cc4deaac83cf4a75a0a103','+19164227507','+18777929310','voice','new','http://api.twilio.com/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/Recordings/REcab3e6505fa3a286b0f8acf7217912e2','Hi this is theresa dillon there and I was calling about a typo or s. as in sam 113 stainless steel ... kitchen sink hi michelle sent your out of stock but I was wondering when you will have them in stock again if you could please give me a call as soon as possible my number here is (916) 402-1051 thank you and have a great day.','',30,NULL,0,'open',1),(8,'2012-07-11 12:03:18','2012-07-11 12:03:55',NULL,'CA30079b31ec88a7664a0aa55f1bb87781','+18605787855','+18777929310','voice','new','http://api.twilio.com/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/Recordings/RE4c625e094b6a79bc196f3ce12fbd1fa1','Good morning my name is ron siemens this is in the back to a. c. tech watch it ... it\'s the just you know model l. 1 victor lima 0 dash 5 I\'m looking to understand what the what the configuration is on the spring uncle please return the call 218605787855 thank you.','',34,NULL,0,'open',1),(9,'2012-07-11 12:08:46','2012-07-11 12:09:30',NULL,'CAff819fe1aa2bfecc72bffb6b546366eb','+12078315203','+18777929310','voice','new','http://api.twilio.com/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/Recordings/RE70e413380e7d624ca621a4e639fcf061','Hi ... chris or steve this is lisa porter and it\'s wednesday about 8078 and ... july eleventh ... I never did receive ... an email with the tracking number for the kraus ... you know handle ... kitchen faucet so ... the guy the here today to install and ... since I don\'t have the faucet ... once it does get here I am just going to ... request you all give me ... I\'ll return shipping ... for it and then credit us fax for the unit ... give me a call (207) 831-5203 thank you.','',60,NULL,0,'open',1),(10,'2012-07-11 12:12:53','2012-07-11 12:13:09',NULL,'CAaf775b71c8802392f99949013ace66c2','+17168637424','+18777929310','voice','new','http://api.twilio.com/2010-04-01/Accounts/AC029a65932d6fcacffc41f26ff125dbb7/Recordings/RE43bab3ede1d0867093dd22f2eb08348d','This is nick this gal you\'re calling please have someone call me at 71686387424 that\'s (716) 863-7424 thank you.','',24,NULL,0,'open',1);

--
-- Table structure for table `numbers`
--

CREATE TABLE `numbers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  `value` text NOT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `sms` tinyint(1) DEFAULT '0',
  `sequence` smallint(6) DEFAULT NULL,
  `tenant_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `tenant_id` (`tenant_id`),
  CONSTRAINT `numbers_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `numbers_ibfk_2` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `numbers`
--

INSERT INTO `numbers` VALUES (1,1,'Chris\' Cell','+17043266746',1,0,NULL,1),(2,2,'Primary Device','+17047632435',1,0,NULL,1);

--
-- Table structure for table `plugin_store`
--

CREATE TABLE `plugin_store` (
  `key` varchar(255) NOT NULL,
  `value` text,
  `plugin_id` varchar(34) NOT NULL,
  `tenant_id` bigint(20) NOT NULL,
  UNIQUE KEY `key_plugin` (`key`,`plugin_id`,`tenant_id`),
  KEY `key` (`key`,`plugin_id`),
  KEY `tenant_id` (`tenant_id`),
  CONSTRAINT `plugin_store_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `plugin_store`
--


--
-- Table structure for table `rest_access`
--

CREATE TABLE `rest_access` (
  `key` varchar(32) NOT NULL,
  `locked` tinyint(4) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL,
  `user_id` int(11) NOT NULL,
  `tenant_id` bigint(20) NOT NULL,
  PRIMARY KEY (`key`),
  KEY `tenant_id` (`tenant_id`),
  CONSTRAINT `rest_access_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `rest_access`
--


--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) NOT NULL,
  `name` varchar(32) NOT NULL,
  `value` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `name` (`name`),
  KEY `tenant_id` (`tenant_id`,`name`),
  CONSTRAINT `settings_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` VALUES (1,1,'dash_rss',''),(2,1,'theme',''),(3,1,'iphone_theme',''),(4,1,'enable_sandbox_number','1'),(5,1,'twilio_endpoint','https://api.twilio.com/2010-04-01'),(6,1,'recording_host',''),(7,1,'transcriptions','1'),(8,1,'voice','man'),(9,1,'voice_language','en'),(10,1,'numbers_country','US'),(11,1,'gravatars','0'),(12,1,'connect_application_sid',''),(13,1,'dial_timeout','15'),(14,1,'email_notifications_voice','1'),(15,1,'email_notifications_sms','1'),(16,1,'twilio_sid','AC029a65932d6fcacffc41f26ff125dbb7'),(17,1,'twilio_token','02c91a477cc5d931be6847a93a7f34ba'),(18,1,'from_email','calls@zigsbyskitchen.com'),(19,1,'trial_number','(415) 599-2671'),(20,1,'schema-version','75'),(21,1,'rewrite_enabled','1'),(22,1,'application_sid','AP0a7931ee0ab2a43158ef9d6e88a0bfce');

--
-- Table structure for table `tenants`
--

CREATE TABLE `tenants` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `url_prefix` varchar(255) NOT NULL,
  `local_prefix` varchar(1000) NOT NULL,
  `active` tinyint(4) NOT NULL DEFAULT '1',
  `type` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `name` (`name`),
  KEY `url_prefix` (`url_prefix`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tenants`
--

INSERT INTO `tenants` VALUES (1,'default','','',1,0);

--
-- Table structure for table `user_annotations`
--

CREATE TABLE `user_annotations` (
  `user_id` int(11) NOT NULL,
  `annotation_id` bigint(20) NOT NULL,
  `tenant_id` bigint(20) NOT NULL,
  PRIMARY KEY (`user_id`,`annotation_id`),
  KEY `tenant_id` (`tenant_id`),
  CONSTRAINT `user_annotations_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `user_annotations`
--


--
-- Table structure for table `user_messages`
--

CREATE TABLE `user_messages` (
  `user_id` int(11) NOT NULL,
  `message_id` int(11) NOT NULL,
  `tenant_id` bigint(20) NOT NULL,
  PRIMARY KEY (`user_id`,`message_id`),
  KEY `tenant_id` (`tenant_id`),
  KEY `message_id` (`message_id`),
  CONSTRAINT `user_messages_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `user_messages_ibfk_2` FOREIGN KEY (`message_id`) REFERENCES `messages` (`id`),
  CONSTRAINT `user_messages_ibfk_3` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `user_messages`
--


--
-- Table structure for table `user_settings`
--

CREATE TABLE `user_settings` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `key` varchar(255) DEFAULT NULL,
  `value` text,
  `tenant_id` int(11) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `user_key` (`user_id`,`key`),
  KEY `key` (`key`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `user_settings`
--

INSERT INTO `user_settings` VALUES (3,1,'online','0',1),(4,1,'last_login','2012-07-03 12:52:13',1),(5,1,'last_seen','2012-07-03 13:52:16',1),(6,2,'online','9',1),(7,0,'online','9',1),(8,2,'last_login','2012-07-03 12:46:39',1),(9,2,'last_seen','2012-07-03 12:47:35',1);

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

CREATE TABLE `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `is_admin` tinyint(1) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `first_name` varchar(100) DEFAULT NULL,
  `last_name` varchar(100) DEFAULT NULL,
  `password` varchar(128) DEFAULT NULL,
  `invite_code` varchar(32) DEFAULT NULL,
  `email` varchar(200) DEFAULT NULL,
  `pin` varchar(40) DEFAULT NULL,
  `notification` varchar(20) DEFAULT NULL,
  `auth_type` tinyint(4) NOT NULL DEFAULT '1',
  `voicemail` text NOT NULL,
  `tenant_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`,`tenant_id`),
  KEY `tenant_id` (`tenant_id`),
  KEY `auth_type` (`auth_type`),
  CONSTRAINT `users_ibfk_1` FOREIGN KEY (`auth_type`) REFERENCES `auth_types` (`id`),
  CONSTRAINT `users_ibfk_2` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

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

INSERT INTO `users` VALUES (1,1,1,'Chris','Carter','$P$BT..aR.HeKs6pbTh.ppuPtzzo0kMqH.',NULL,'chris@zigsbyskitchen.com',NULL,NULL,1,'Please leave a message after the beep.',1),(2,1,1,'Steve','Lyerly','$P$BzzVfaUw67iTcebuCXh/pv1eQUxout1','JFAkQmQxcC9hWE5tSGNJ','steve@zigsbyskitchen.com',NULL,NULL,1,'',1);


