-- phpMyAdmin SQL Dump
-- version 4.0.9
-- version PHP: 5.3.27

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

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

--
-- Table `comments`
--

CREATE TABLE IF NOT EXISTS `comments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `post_id` int(50) NOT NULL,
  `comment` text NOT NULL,
  `anonymous` set('0','1') NOT NULL,
  `to_user` varchar(50) NOT NULL,
  `from_user` varchar(50) NOT NULL,
  `post_user` varchar(25) NOT NULL,
  `time` int(20) NOT NULL,
  `alive` set('0','1') NOT NULL,
  `viewed` set('0','1') NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table `gifts`
--

CREATE TABLE IF NOT EXISTS `gifts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `to_user` varchar(50) NOT NULL,
  `from_user` varchar(50) NOT NULL,
  `gift_id` int(11) NOT NULL,
  `type` enum('0','1','2') NOT NULL COMMENT '0-anonym 1-public only for user 2-public',
  `text` varchar(50) NOT NULL,
  `time` varchar(30) NOT NULL,
  `position_x` int(11) NOT NULL,
  `position_y` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table `giftstype`
--

CREATE TABLE IF NOT EXISTS `giftstype` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(25) NOT NULL,
  `image` varchar(80) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table `likes`
--

CREATE TABLE IF NOT EXISTS `likes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `post_id` int(11) NOT NULL,
  `user` varchar(25) NOT NULL,
  `to_user` varchar(25) NOT NULL,
  `post_user` varchar(25) NOT NULL,
  `viewed` int(11) NOT NULL COMMENT '0 - nobody, 1 - to_user, 10 - post_user, 11 - both',
  `time` int(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table `payments`
--

CREATE TABLE IF NOT EXISTS `payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(40) NOT NULL,
  `transaction_id` varchar(80) NOT NULL,
  `payer_email` varchar(80) NOT NULL,
  `user` varchar(80) NOT NULL,
  `quantity` int(11) NOT NULL,
  `date` varchar(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table `paypal_settings`
--

CREATE TABLE IF NOT EXISTS `paypal_settings` (
  `pay_mode` varchar(30) NOT NULL COMMENT 'sandbox or live',
  `apiusername` varchar(80) NOT NULL,
  `apipassword` varchar(80) NOT NULL,
  `apisignature` varchar(80) NOT NULL,
  `currencycode` varchar(10) NOT NULL,
  `price` float NOT NULL,
  `enabled` enum('0','1') NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table `posts`
--

CREATE TABLE IF NOT EXISTS `posts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `to_user` varchar(400) NOT NULL,
  `post` text NOT NULL,
  `image` varchar(80) NOT NULL,
  `from_user` varchar(100) NOT NULL,
  `status` set('0','1') NOT NULL,
  `viewed` set('0','1') NOT NULL,
  `anonymous` set('0','1') NOT NULL,
  `ip` varchar(30) NOT NULL,
  `time` varchar(30) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table `site_config`
--

CREATE TABLE IF NOT EXISTS `site_config` (
  `website_name` varchar(500) NOT NULL,
  `website_domain` text NOT NULL,
  `website_keywords` text NOT NULL,
  `website_description` text NOT NULL,
  `website_free_points` set('0','1') NOT NULL DEFAULT '1',
  `website_gift_price` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table `users`
--

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(100) NOT NULL,
  `password` text NOT NULL,
  `real_name` varchar(400) NOT NULL,
  `real_surname` varchar(400) NOT NULL,
  `points` int(11) NOT NULL,
  `rank` enum('0','1','2') NOT NULL,
  `verified` enum('0','1') NOT NULL DEFAULT '0',
  `email` varchar(200) NOT NULL,
  `website` varchar(300) NOT NULL,
  `localization` varchar(300) NOT NULL,
  `bio` text NOT NULL,
  `user_status` varchar(400) NOT NULL,
  `theme` enum('default','background','agenda','birch','birds','blackcross','blackromb','bluebulles','bluemettal','cyanmettal','greenlines','greenmettal','greymettal','ice','isumrudic','lined_paper','mosaic','noisygrid','notes','orangelines','paper','pink','pinkmettal','pinstripe','redcircle','redmettal','vintage','whitemosaic','whitestripped','wood','yellowmettal','photo') NOT NULL,
  `background` text NOT NULL,
  `photo` text NOT NULL,
  `cover` varchar(80) NOT NULL,
  `status` enum('0','1') NOT NULL,
  `ip` varchar(50) NOT NULL,
  `anonymous_view` enum('0','1') NOT NULL,
  `reg_date` varchar(20) NOT NULL,
  `lang` varchar(2) NOT NULL DEFAULT 'en',
  `visit` int(20) NOT NULL,
  `facebook` varchar(500) NOT NULL,
  `vkontakte` varchar(500) NOT NULL,
  `twitter` varchar(500) NOT NULL,
  `googleplus` varchar(500) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`),
  KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table `users_blocked`
--

CREATE TABLE IF NOT EXISTS `users_blocked` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(400) NOT NULL,
  `blocked` varchar(400) NOT NULL,
  `status` enum('0','1') NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

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

--
-- Table `users_friends`
--

CREATE TABLE IF NOT EXISTS `users_friends` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(400) NOT NULL COMMENT 'User name',
  `friend` varchar(400) NOT NULL COMMENT 'Friend user name',
  `status` enum('0','1') NOT NULL COMMENT '1 - is friend, 0 - deleted from friend list',
  `time` int(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `username` (`username`(255))
) ENGINE=MyISAM DEFAULT CHARSET=utf8 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 */;
