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




--
-- Database: `chumber_app`
--

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

--
-- Table structure for table `media`
--

CREATE TABLE IF NOT EXISTS `media` (
  `m_id` int(15) NOT NULL AUTO_INCREMENT COMMENT 'Media id',
  `s_id` int(15) NOT NULL COMMENT 'sender id',
  `r_id` varchar(250) NOT NULL COMMENT 'Reciever id',
  `file_path` varchar(300) NOT NULL COMMENT 'path of the file',
  `timer` int(2) NOT NULL COMMENT 'time for viewing',
  `ref_count` int(3) NOT NULL COMMENT 'reference count',
  `type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1 - image, 2 - video',
  `datetime` datetime NOT NULL COMMENT 'creation date and time',
  `isCleared` tinyint(1) NOT NULL DEFAULT '2' COMMENT '1 - cleared, 2 -not, 3- deleted',
  PRIMARY KEY (`m_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Stores media data shared between users' AUTO_INCREMENT=11 ;

--
-- Dumping data for table `media`
--

INSERT INTO `media` (`m_id`, `s_id`, `r_id`, `file_path`, `timer`, `ref_count`, `type`, `datetime`, `isCleared`) VALUES
(1, 142, '143', 'SnapSnapImage_Wed_03_26_2014_17_02_47.jpeg', 10, 1, 1, '2014-03-26 17:02:47', 2),
(2, 142, '143', 'SnapVideo_Wed_03_26_2014_17_13_46.mp4', 10, 1, 1, '2014-03-26 17:13:47', 2),
(3, 142, '143', 'SnapSnapImage_Wed_03_26_2014_17_48_25.jpeg', 10, 1, 1, '2014-03-26 17:48:25', 2),
(4, 142, '143', 'SnapSnapImage_Thu_03_27_2014_10_39_24.jpeg', 10, 0, 1, '2014-03-27 10:39:24', 2),
(5, 143, '142', 'SnapSnapImage_Thu_03_27_2014_10_42_12.jpeg', 10, 0, 1, '2014-03-27 10:42:12', 2),
(6, 142, '143', 'SnapSnapImage_Thu_03_27_2014_11_52_09.jpeg', 10, 1, 1, '2014-03-27 11:52:09', 2),
(7, 143, '142', 'SnapSnapImage_Thu_03_27_2014_11_58_20.jpeg', 1, 1, 1, '2014-03-27 11:58:20', 2),
(8, 143, '142', 'SnapVideo_Thu_03_27_2014_12_02_16.mp4', 1, 1, 1, '2014-03-27 12:02:16', 2),
(9, 143, '142', 'SnapSnapImage_Thu_03_27_2014_12_10_03.jpeg', 10, 1, 1, '2014-03-27 12:10:03', 2),
(10, 143, '142', 'SnapSnapImage_Thu_03_27_2014_12_18_34.jpeg', 10, 1, 1, '2014-03-27 12:18:34', 2);

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

--
-- Table structure for table `myfriends`
--

CREATE TABLE IF NOT EXISTS `myfriends` (
  `id` int(15) NOT NULL AUTO_INCREMENT COMMENT 'invite id',
  `my_id` int(15) NOT NULL COMMENT 'user who sent the request',
  `friend_id` int(15) NOT NULL COMMENT 'freint to whom request is sent',
  `contact_name` varchar(150) DEFAULT NULL,
  `joined` datetime DEFAULT NULL COMMENT 'accepted/rejected date and time',
  `invited` datetime NOT NULL COMMENT 'invited date and time',
  `isApproved` tinyint(1) NOT NULL DEFAULT '3' COMMENT '1 - accpet, 2 - block, 3 - pending, 4 - inactive',
  `Sender` tinyint(1) NOT NULL DEFAULT '2' COMMENT '1 - yes, 2 - no -- who sends invitation to add friend',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='User friends data' AUTO_INCREMENT=23 ;

--
-- Dumping data for table `myfriends`
--

INSERT INTO `myfriends` (`id`, `my_id`, `friend_id`, `contact_name`, `joined`, `invited`, `isApproved`, `Sender`) VALUES
(1, 143, 142, NULL, '2014-03-26 15:27:58', '2014-03-26 15:27:58', 1, 1),
(2, 142, 143, NULL, '2014-03-26 15:27:58', '2014-03-26 15:27:58', 1, 2),
(3, 143, 141, NULL, '2014-03-26 15:36:01', '2014-03-26 15:36:01', 1, 1),
(4, 141, 143, NULL, '2014-03-26 15:36:01', '2014-03-26 15:36:01', 1, 2),
(5, 143, 145, NULL, '2014-03-26 15:36:02', '2014-03-26 15:36:02', 1, 1),
(6, 145, 143, NULL, '2014-03-26 15:36:02', '2014-03-26 15:36:02', 1, 2),
(7, 143, 146, NULL, '2014-03-26 15:36:02', '2014-03-26 15:36:02', 1, 1),
(8, 146, 143, NULL, '2014-03-26 15:36:02', '2014-03-26 15:36:02', 1, 2),
(9, 143, 140, NULL, '2014-03-26 15:36:07', '2014-03-26 15:36:07', 1, 1),
(10, 140, 143, NULL, '2014-03-26 15:36:07', '2014-03-26 15:36:07', 1, 2),
(11, 143, 144, NULL, '2014-03-26 15:36:10', '2014-03-26 15:36:10', 1, 1),
(12, 144, 143, NULL, '2014-03-26 15:36:10', '2014-03-26 15:36:10', 1, 2),
(13, 142, 146, NULL, '2014-03-26 15:39:22', '2014-03-26 15:39:22', 1, 1),
(14, 146, 142, NULL, '2014-03-26 15:39:22', '2014-03-26 15:39:22', 1, 2),
(15, 142, 140, NULL, '2014-03-26 15:39:23', '2014-03-26 15:39:23', 1, 1),
(16, 140, 142, NULL, '2014-03-26 15:39:23', '2014-03-26 15:39:23', 1, 2),
(17, 142, 141, NULL, '2014-03-26 15:39:27', '2014-03-26 15:39:27', 1, 1),
(18, 141, 142, NULL, '2014-03-26 15:39:27', '2014-03-26 15:39:27', 1, 2),
(19, 142, 144, NULL, '2014-03-26 15:39:28', '2014-03-26 15:39:28', 1, 1),
(20, 144, 142, NULL, '2014-03-26 15:39:28', '2014-03-26 15:39:28', 1, 2),
(21, 142, 145, NULL, '2014-03-26 15:39:28', '2014-03-26 15:39:28', 1, 1),
(22, 145, 142, NULL, '2014-03-26 15:39:28', '2014-03-26 15:39:28', 1, 2);

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

--
-- Table structure for table `notifications`
--

CREATE TABLE IF NOT EXISTS `notifications` (
  `id` int(20) NOT NULL AUTO_INCREMENT,
  `owner_id` int(15) NOT NULL,
  `reciever_id` int(15) NOT NULL,
  `datetime` datetime NOT NULL,
  `message` varchar(500) NOT NULL,
  `cleared` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1 - no, 2- yes, 3 -deleted',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=24 ;

--
-- Dumping data for table `notifications`
--

INSERT INTO `notifications` (`id`, `owner_id`, `reciever_id`, `datetime`, `message`, `cleared`) VALUES
(1, 143, 142, '2014-03-26 15:28:32', 'Congratulations! vipul wants to add you as a friend on the Sneak Peek app!', 1),
(2, 143, 141, '2014-03-26 15:36:35', 'Congratulations! vipul wants to add you as a friend on the Sneak Peek app!', 1),
(3, 143, 145, '2014-03-26 15:36:35', 'Congratulations! vipul wants to add you as a friend on the Sneak Peek app!', 1),
(4, 143, 146, '2014-03-26 15:36:35', 'Congratulations! vipul wants to add you as a friend on the Sneak Peek app!', 1),
(5, 143, 140, '2014-03-26 15:36:40', 'Congratulations! vipul wants to add you as a friend on the Sneak Peek app!', 1),
(6, 143, 144, '2014-03-26 15:36:44', 'Congratulations! vipul wants to add you as a friend on the Sneak Peek app!', 1),
(7, 142, 146, '2014-03-26 15:39:24', 'Congratulations! deep wants to add you as a friend on the Sneak Peek app!', 1),
(8, 142, 140, '2014-03-26 15:39:25', 'Congratulations! deep wants to add you as a friend on the Sneak Peek app!', 1),
(9, 142, 141, '2014-03-26 15:39:29', 'Congratulations! deep wants to add you as a friend on the Sneak Peek app!', 1),
(10, 142, 144, '2014-03-26 15:39:30', 'Congratulations! deep wants to add you as a friend on the Sneak Peek app!', 1),
(11, 142, 145, '2014-03-26 15:39:30', 'Congratulations! deep wants to add you as a friend on the Sneak Peek app!', 1),
(12, 142, 143, '2014-03-26 17:02:49', 'From: deep', 1),
(13, 142, 143, '2014-03-26 17:13:50', 'From: deep', 1),
(14, 142, 143, '2014-03-26 17:48:26', 'From: deep', 1),
(15, 142, 143, '2014-03-27 10:39:30', 'From: deep', 1),
(16, 143, 142, '2014-03-27 10:40:56', 'From: vipul', 1),
(17, 143, 142, '2014-03-27 10:42:21', 'From: vipul', 1),
(18, 142, 143, '2014-03-27 10:43:24', 'From: deep', 1),
(19, 142, 143, '2014-03-27 11:52:09', 'From: deep', 1),
(20, 143, 142, '2014-03-27 11:58:21', 'From: vipul', 1),
(21, 143, 142, '2014-03-27 12:02:17', 'From: vipul', 1),
(22, 143, 142, '2014-03-27 12:10:04', 'From: vipul', 1),
(23, 143, 142, '2014-03-27 12:18:35', 'From: vipul', 1);

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

--
-- Table structure for table `notificationtype`
--

CREATE TABLE IF NOT EXISTS `notificationtype` (
  `id` int(15) NOT NULL AUTO_INCREMENT COMMENT 'Notification id',
  `type` varchar(100) NOT NULL COMMENT 'Notification type',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stores types of notifications' AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `statusmessages`
--

CREATE TABLE IF NOT EXISTS `statusmessages` (
  `sid` int(5) NOT NULL AUTO_INCREMENT,
  `statusNumber` varchar(5) NOT NULL,
  `statusMessage` varchar(250) NOT NULL,
  PRIMARY KEY (`sid`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=86 ;

--
-- Dumping data for table `statusmessages`
--

INSERT INTO `statusmessages` (`sid`, `statusNumber`, `statusMessage`) VALUES
(2, '1', 'Invalid name entered'),
(4, '2', 'Incorrect email address'),
(7, '3', 'Username not available, choose another'),
(11, '4', 'UUID already exists'),
(12, '5', 'Passwords not matched'),
(13, '6', 'Email Unavailable, choose another'),
(14, '7', 'Mandatory field missing'),
(16, '9', 'Error completing signup'),
(18, '11', 'Failed to login the user'),
(19, '12', 'We cant find an account with that username'),
(20, '13', 'Session token expired'),
(21, '14', 'Incorrect session token'),
(23, '16', 'Failed to update the profile'),
(24, '17', 'QBID unavailable, choose another'),
(25, '0', 'Process completed successfully'),
(26, '18', 'Failed to update the token'),
(27, '19', 'UserId not registered'),
(28, '20', 'Owner unregistered'),
(31, '23', 'Email does not exist'),
(32, '24', 'Notification sent, failed to store in database'),
(33, '25', 'Failed to send push notification'),
(34, '26', 'Failed connecting to apple server'),
(35, '27', 'Token unavailable for the selected user'),
(36, '28', 'Logout not completed successfully'),
(37, '29', 'Data base error, failed to login the user'),
(39, '31', 'Notifications not available'),
(50, '42', 'Users not found'),
(57, '49', 'File size greater than maximum'),
(59, '51', 'Failed to add friend'),
(60, '8', 'Please activate your account by clicking on a link sent to your registered email.'),
(61, '10', 'Time should be between 1 to 10 only'),
(62, '15', 'Specify time for the snap'),
(63, '21', 'Failed to insert media'),
(64, '22', 'Please upload an image file'),
(65, '30', 'You dont have anyone in contacts'),
(66, '32', 'You already added this person'),
(67, '33', 'You cant add your self in contacts'),
(68, '34', 'Failed to clear feeds.'),
(69, '35', 'No feeds to clear.'),
(70, '36', 'Failed to edit the name'),
(71, '37', 'Failed to delete snap'),
(72, '38', 'Nothing to update'),
(73, '40', 'Failed to update'),
(74, '41', 'Failed to make server connection'),
(75, '53', 'Unable to send email'),
(76, '39', 'That''s not the right password. Sorry!'),
(77, '43', 'We cant find an account with that Email.'),
(78, '44', 'Password rest email sent! It may take a few minutes to get to you.'),
(79, '45', 'Token already updated as provided.'),
(80, '46', 'You are logged in already in other device, multiple logins not possible!'),
(81, '48', 'Uploading failed'),
(82, '11', 'heloo'),
(83, '12', 'hi'),
(84, '39', 'erro'),
(85, '11', 'eror');

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

--
-- Table structure for table `user_media_map`
--

CREATE TABLE IF NOT EXISTS `user_media_map` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'map id',
  `u_id` int(15) NOT NULL COMMENT 'user id',
  `m_id` int(20) NOT NULL COMMENT 'media id',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0 - pending, 1 - viewed',
  `dateviewed` datetime DEFAULT NULL COMMENT 'date time of opening the attachment',
  `action` int(2) NOT NULL COMMENT '1 - pending, 2 - viewed, 3 - snapTaken, 4 - clear',
  `ownerCleared` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1 - no, 2 - yes',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='User media mapping table' AUTO_INCREMENT=11 ;

--
-- Dumping data for table `user_media_map`
--

INSERT INTO `user_media_map` (`id`, `u_id`, `m_id`, `status`, `dateviewed`, `action`, `ownerCleared`) VALUES
(1, 143, 1, 0, NULL, 1, 1),
(2, 143, 2, 0, NULL, 1, 1),
(3, 143, 3, 0, NULL, 1, 1),
(4, 143, 4, 1, '2014-03-27 10:40:55', 2, 1),
(5, 142, 5, 1, '2014-03-27 10:43:21', 2, 1),
(6, 143, 6, 0, NULL, 1, 1),
(7, 142, 7, 0, NULL, 1, 1),
(8, 142, 8, 0, NULL, 1, 1),
(9, 142, 9, 0, NULL, 1, 1),
(10, 142, 10, 0, NULL, 1, 1);

