-- phpMyAdmin SQL Dump
-- version 3.4.10.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 16, 2012 at 01:01 PM
-- Server version: 5.1.63
-- PHP Version: 5.2.6

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

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

--
-- Table structure for table `config`
--

CREATE TABLE IF NOT EXISTS `config` (
  `field` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `value` varchar(1500) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `config`
--

INSERT INTO `config` (`field`, `value`) VALUES
('body', 'YTo2OntzOjc6Im1lc3NhZ2UiO3M6ODU6IlRoaXMgTGluayBpcyBwb3N0ZWQgd2hlbiB1c2VyIGFjY2VzcyB0aGUgY29udGVzdCBmb3IgZmlyc3QgdGltZSwgY3VzdG9taXplIGZyb20gYWRtaW4iO3M6NDoibmFtZSI7czoyMDoiQ3VzdG9tIENvbnRlc3QgVGl0bGUiO3M6NzoiY2FwdGlvbiI7czo3OiJDb250ZXN0IjtzOjQ6ImxpbmsiO3M6MzI6Imh0dHA6Ly93d3cuYXBwc3RpY28uY29tL2NvbnRlc3QvIjtzOjc6InBpY3R1cmUiO3M6NDI6Imh0dHA6Ly9hcHBzdGljby5jb20vY29udGVzdC9pbWFnZXMvYXBwLnBuZyI7czoxMToiZGVzY3JpcHRpb24iO3M6MjY6IkN1c3RvbSBDb250ZXN0IERlc2NyaXB0aW9uIjt9'),
('auto_post', '1'),
('version', '1'),
('end_date', '2012-10-03 00:00'),
('auto_approve', '0'),
('approved_email', 'Thanks for participating in our Contest<br><br>\r\n\r\nYour Photo was approved.<br><br>\r\n\r\nNow you can start promoting it to get more Votes.<br><br>\r\n\r\nYour photo promotion link: {%-Click Here-%}<br><br>\r\n\r\nHow to promote:<br>\r\nOn your photo page, below the photo you will see three buttons: Vote, Share, Invite.<br>\r\nUse the Share and Invite buttons to share and invite your friends to vote for your photo.<br>\r\nSend emails to your friends with you photo link asking them to vote for your photo.<br>\r\nAsk your friends in chat.<br>\r\nPost you photo link on forums, blogs etc.<br>\r\nAnd any other way you can think.<br><br>\r\n\r\nNo cheating, your photo may be removed.<br><br>\r\n\r\nGood Luck<br><br>\r\n\r\nNo Replay to this message<br>'),
('deleted_email', 'Thanks for participating in our Contest<br><br>\r\n\r\nWe are sorry to inform you that your Photo was not approved.<br><br>\r\n\r\nPlease read the contest roles and try uploading new photo.<br><br>\r\n\r\nThanks<br><br>\r\n\r\nNo Replayto this message<br>\r\n\r\n');

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

--
-- Table structure for table `photos`
--

CREATE TABLE IF NOT EXISTS `photos` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL,
  `filename` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `orig_ext` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'jpg',
  `caption` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `description` varchar(2000) COLLATE utf8_unicode_ci NOT NULL,
  `version` int(3) NOT NULL,
  `approved` tinyint(1) NOT NULL DEFAULT '0',
  `votes` int(10) unsigned NOT NULL DEFAULT '0',
  `upload_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`,`version`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `requests`
--

CREATE TABLE IF NOT EXISTS `requests` (
  `id` bigint(10) NOT NULL AUTO_INCREMENT,
  `request_id` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `fb_id` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `photo_id` bigint(20) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

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

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

CREATE TABLE IF NOT EXISTS `users` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `uid` bigint(20) NOT NULL,
  `email` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `access_token` varchar(255) NOT NULL,
  `registered_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `votes`
--

CREATE TABLE IF NOT EXISTS `votes` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `pic_id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `vote_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `pic_id` (`pic_id`,`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=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 */;
