-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 27, 2014 at 07:51 AM
-- Server version: 5.5.27
-- PHP Version: 5.4.7

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- 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`
--

CREATE TABLE IF NOT EXISTS `user` (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'Identifier',
  `firstName` varchar(25) DEFAULT NULL COMMENT 'First name.',
  `LastName` varchar(25) DEFAULT NULL COMMENT 'Last name.',
  `UserName` varchar(25) NOT NULL COMMENT 'Unique identifier for the user',
  `Email` varchar(50) NOT NULL COMMENT 'Registered email account.',
  `Password` varchar(25) NOT NULL COMMENT 'User password. Not encrypted for this phase.',
  `createDt` datetime NOT NULL COMMENT 'Date/time of creation.',
  `lastUpDt` datetime NOT NULL COMMENT 'Date/time of last update.',
  `IsdCode` varchar(10) DEFAULT NULL,
  `Phone` varchar(50) DEFAULT NULL COMMENT 'Phone number',
  `ImgUrl` varchar(500) DEFAULT NULL,
  `Country` varchar(50) NOT NULL,
  `Sex` tinyint(1) DEFAULT NULL COMMENT 'Gender, 1- male, 2- female',
  `QBid` varchar(100) DEFAULT NULL,
  `UUID` varchar(500) NOT NULL COMMENT 'Device unique id',
  `Token` varchar(600) DEFAULT NULL COMMENT 'Token for push notification',
  `DeviceType` int(3) NOT NULL COMMENT '1- iphone, 2- android',
  `sessToken` varchar(1000) NOT NULL COMMENT 'stores session token',
  `expDate` datetime NOT NULL COMMENT 'session expiry time',
  `loginFlag` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 if logged in',
  `isActive` tinyint(1) NOT NULL DEFAULT '2' COMMENT '1 - yes, 2 - no, 3 - deleted',
  `activateLink` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0 - unused, 1 - used',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=147 ;

--
-- Dumping data for table `user`
--

INSERT INTO `user` (`id`, `firstName`, `LastName`, `UserName`, `Email`, `Password`, `createDt`, `lastUpDt`, `IsdCode`, `Phone`, `ImgUrl`, `Country`, `Sex`, `QBid`, `UUID`, `Token`, `DeviceType`, `sessToken`, `expDate`, `loginFlag`, `isActive`, `activateLink`) VALUES
(140, NULL, NULL, 'testuser', 'testemail@test.com', 'password', '2014-02-25 14:40:58', '2014-02-25 15:03:21', NULL, '1234567890', NULL, 'India', NULL, NULL, 'ED64B9CC-1FC3-4D24-9CE3-E257734E5BED', '(null)', 1, '74657374656D61696C40746573742E636F6D32443445333933442D443342332D344139452D384632442D3443376KvI8lADo6rQAHHANwL634374531323539344276KvI8lADo6rQAHHANwL', '2014-03-29 07:35:49', 0, 1, 0),
(141, NULL, NULL, 'user1', 'testemail1@email.com', 'user1', '2014-02-25 14:49:10', '2014-02-25 15:06:10', NULL, '1234567890', NULL, 'India', NULL, NULL, 'ED64B9CC-1FC3-4D24-9CE3-E257734E5BED', '(null)', 1, '74657374656D61696C3140656D61696C2E636F6D4544CknAh1mWDHqF7aAf91iT3634423943432D314643332D344432342D394345332D453235373733344535424544CknAh1mWDHqF7aAf91iT', '2014-02-27 10:39:19', 0, 1, 0),
(142, NULL, NULL, 'deep', 'deep@gmail.com', '123123', '2014-03-26 14:49:17', '2014-03-27 11:38:52', NULL, '9876543210', NULL, 'India', NULL, NULL, 'E4054A6E-0340-48DE-B7E0-CFBE3469C7CA', '(null)', 1, '6465657040676D61696C2E636F6D32304436314332342D424537312D343230452D393946412D313942334341313831413833Xr1uASVpM1tXr1uASVpM1tAm0umSJPoAm0umSJPo', '2014-03-29 07:31:46', 0, 1, 0),
(143, NULL, NULL, 'vipul', 'vipul@gmail.com', '123123', '2014-03-26 14:54:33', '2014-03-27 12:09:51', NULL, '9876543210', NULL, 'India', NULL, NULL, '0DF1E4EC-A593-4AD0-987E-7B894C800519', '83a36b8773c9d2340e9e148b7369841d66bcacbe50481650def8fef41856fbe4', 1, '766970756C40676D61696C2E636F6D39443432374630392D374437332D343341382D413741442D333946Em0cQ1SRJlKiD7IRKfwu344236454638313135Em0cQ1SRJlKiD7IRKfwu', '2014-03-29 07:49:00', 1, 1, 0),
(144, NULL, NULL, 'test', 'test@gmail.com', '123123', '2014-03-26 15:18:19', '2014-03-26 15:18:20', NULL, '1234567890', NULL, 'India', NULL, NULL, 'A3399502-1533-45FC-968C-B74F82D83A61', '(null)', 1, '7465737440676D61696C2E636F6D41333339393530322D313533332D343546432D393638432D4237344638324438ccGSxgJzKlPf4jk1v2Rw33413631ccGSxgJzKlPf4jk1v2Rw', '2014-03-28 10:48:52', 1, 1, 0),
(145, NULL, NULL, 'test1', 'test1@gmail.com', '123123', '2014-03-26 15:18:54', '2014-03-26 15:18:54', NULL, '12344567890', NULL, 'India', NULL, NULL, 'A3399502-1533-45FC-968C-B74F82D83A61', '(null)', 1, '746573743140676D61696C2E636F6D413333393935302l0FJ9jmwNSiyLtNZnhm322D313533332D343546432D393638432D4237344638324438334136312l0FJ9jmwNSiyLtNZnhm', '2014-03-28 10:49:27', 1, 1, 0),
(146, NULL, NULL, 'test2', 'test2@gmail.com', '123123', '2014-03-26 15:19:12', '2014-03-26 15:19:12', NULL, '12344556778', NULL, 'India', NULL, NULL, 'A3399502-1533-45FC-968C-B74F82D83A61', '(null)', 1, '746573743240676D61696C2E636F6D41333339393530322D3135Q4dSuqMlAIBZldVFdc2x33332D343546432D393638432D423734463832443833413631Q4dSuqMlAIBZldVFdc2x', '2014-03-28 10:49:44', 1, 1, 0);

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

--
-- 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);

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
