-/*
-Navicat MySQL Data Transfer
-
-Source Server         : localhost
-Source Server Version : 50617
-Source Host           : localhost:3306
-Source Database       : sugar
-
-Target Server Type    : MYSQL
-Target Server Version : 50617
-File Encoding         : 65001
-
-Date: 2016-12-23 18:55:24
-*/
-
-SET FOREIGN_KEY_CHECKS=0;
-
--- ----------------------------
--- Table structure for album
--- ----------------------------
-DROP TABLE IF EXISTS `album`;
-CREATE TABLE `album` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
+-- phpMyAdmin SQL Dump
+-- version 4.4.10
+-- http://www.phpmyadmin.net
+--
+-- Host: localhost
+-- Generation Time: 2017-02-21 14:09:49
+-- 服务器版本： 5.7.17
+-- PHP Version: 5.5.38
+
+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 utf8mb4 */;
+
+--
+-- Database: `sugar`
+--
+
+-- --------------------------------------------------------
+
+--
+-- 表的结构 `album`
+--
+
+CREATE TABLE IF NOT EXISTS `album` (
+  `id` int(11) NOT NULL,
   `album_name` varchar(50) NOT NULL COMMENT '相册名称',
   `album_desc` longtext NOT NULL COMMENT '作品描述',
-  `number` smallint(6) NOT NULL COMMENT '照片总数量',
+  `number` smallint(6) NOT NULL DEFAULT '0' COMMENT '照片总数量',
   `cat_id` int(11) NOT NULL COMMENT '相册所属分类',
   `release_time` int(11) NOT NULL COMMENT '发布时间',
   `recommend` smallint(6) NOT NULL DEFAULT '0' COMMENT '是否被推荐(1为被推荐，0为默认)',

  `user_id` int(11) NOT NULL COMMENT '用户id',
  `birth_date` varchar(50) DEFAULT NULL COMMENT '出生日期',
  `bg_id` int(11) NOT NULL DEFAULT '1' COMMENT '背景id',
  `font_color` enum('#000','#fff') DEFAULT '#fff' COMMENT '字体颜色',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of person_info
-- ----------------------------
INSERT INTO `person_info` VALUES ('1', '小糖人', '/upload/headImg/66308566594693252631482469967.jpg', '上海', '0', '1', '1994-2-5', '1', '#fff');
INSERT INTO `person_info` VALUES ('2', 'Max小马', '/upload/headImg/66305916771660591081482476950.jpg', '浙江绍兴', '0', '2', '1994-2-5', '3', '#fff');
INSERT INTO `person_info` VALUES ('3', '呆呆', '/upload/headImg/66315031723067834311482479039.jpg', '北京', '1', '3', '1998-6-15', '4', '#fff');

-- ----------------------------
-- Table structure for photo
-- ----------------------------
DROP TABLE IF EXISTS `photo`;
CREATE TABLE `photo` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '照片id',
  `big_path` varchar(255) NOT NULL COMMENT '大图路径',
  `status` smallint(6) NOT NULL DEFAULT '1' COMMENT '图片状态（1正常，0禁用）',
  `ogn_name` varchar(255) NOT NULL COMMENT '图片名称',

  `lens` varchar(50) NOT NULL COMMENT '镜头',
  `address` varchar(50) NOT NULL COMMENT '地点',
  `cover` varchar(255) NOT NULL COMMENT '封面路径',
  `visit_num` int(11) DEFAULT '0' COMMENT '访问量'
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8;

--
-- 转存表中的数据 `album`
--

INSERT INTO `album` (`id`, `album_name`, `album_desc`, `number`, `cat_id`, `release_time`, `recommend`, `like`, `user_id`, `browse_num`, `camera`, `lens`, `address`, `cover`, `visit_num`) VALUES
(1, '风景！~', '风景！~', 0, 2, 1482471727, 1, 0, 1, 0, '尼康-D800', '尼康-24 F2.8D', ' 天津', '/upload/2016-12-23/300Nv-T7vh1AKP6_lmb4CH8EJpBU1tdERrY.jpg', 5),
(2, '青海湖！~', '青海', 0, 2, 1482472359, 1, 0, 1, 0, '尼康-D5000', '三星-10-17 F3.5-4.5', ' 山西- 太原', '/upload/2016-12-23/300bOKYYO8v63F-zz2HhvOmIsbK7EnaMEGI.jpg', 0),
(3, '内蒙古大草原!~', '大草原', 0, 2, 1482472536, 1, 0, 1, 0, '佳能-EOS 1000D', '奥林巴斯-11-22 F2.8-3.5', ' 内蒙古- 赤峰', '/upload/2016-12-23/3004xTAce4LNxwebO06VI_IfpRId57-p4kk.jpg', 4),
(4, '欧洲！~', '欧洲', 0, 2, 1482472879, 1, 0, 1, 0, '佳能-EOS 2000D', '奥林巴斯-7-14 F4.0', ' 海外- 瑞士', '/upload/2016-12-23/300KRuwoLi_aMoXbpgSy_vZGVM1w7GEj2Hi.jpg', 3),
(5, '人像！~', '', 0, 20, 1482475883, 1, 0, 1, 0, '佳能-EOS 5D Mark II', '佳能-50 F1.8 ', ' 天津', '/upload/2016-12-23/300G3h7Evj4Rc0r18RWfZSVksZa_92FdbT7.jpg', 2),
(6, '人像！~', '', 0, 21, 1482475951, 1, 0, 1, 0, '佳能-EOS 5D Mark II', '佳能-50 F1.4 USM', ' 上海', '/upload/2016-12-23/3006BwuCaY2oL6hNHTRSdE4jAs3Is5SUzg8.jpg', 0),
(7, '瑞士！~', '', 0, 2, 1482476007, 1, 0, 1, 0, '尼康-D800', '三星-35 F2', ' 海外- 瑞士', '/upload/2016-12-23/300Ovutd7B3_Yb1wIrLVM1oVTcvOk7XprZo.jpg', 1),
(8, '雪乡!~', '', 0, 2, 1482476073, 1, 0, 1, 0, '佳能-EOS 5D Mark II', '佳能-16-35 F2.8L USM', ' 黑龙江- 哈尔滨', '/upload/2016-12-23/300_kya1KM8Y8HooTxIvy825MkIc3G8f_iH.jpg', 5),
(9, '泰国！~', '', 0, 5, 1482476177, 1, 0, 1, 0, '佳能-EOS 1000D', '佳能-18-55 F3.5-5.6 IS', ' 海外- 泰国', '/upload/2016-12-23/300f0k_ye5piXswvBsV42j4QiZ5t5U_ki7A.jpg', 0),
(10, '欧洲！~', '', 0, 6, 1482476236, 1, 0, 1, 0, '佳能-EOS 450D', '佳能-10-22 F3.5-4.5 USM', ' 海外- 德国', '/upload/2016-12-23/300RVP9AUyUlDuYChe8SMHmusRnNzugxtKQ.jpg', 1),
(11, '风景！~', '', 0, 6, 1482476311, 0, 0, 1, 0, '佳能-EOS 350D', '佳能-10-22 F3.5-4.5 USM', ' 西藏- 日喀则', '/upload/2016-12-23/300lHJnVkJKHcxa95bPYiedXxGOlcNze38H.jpg', 0),
(12, '拉萨！~', '', 0, 17, 1482476391, 1, 0, 1, 0, '佳能-EOS 2000D', '宾得-14 F2.8 ', ' 西藏- 拉萨', '/upload/2016-12-23/300XbKWwlyi-HapKy7sW1eJBR5TKzEw_K8v.jpg', 2),
(13, '雪乡！~', '', 0, 8, 1482476439, 0, 0, 1, 0, '佳能-EOS 5D Mark II', '三星-16-45 F4', ' 黑龙江- 哈尔滨', '/upload/2016-12-23/300lAGOnrlSTxFyResLkID13rkwa3GVkCm2.jpg', 0),
(14, '泰国旅拍！~', '', 0, 20, 1482476539, 0, 0, 1, 0, '佳能-EOS 5D Mark II', '佳能-50 F1.8 ', ' 海外- 泰国', '/upload/2016-12-23/3006_cxpNMCYI-xfMAKX4nsHcKcDun4rb20.jpg', 0),
(15, '瑞士', '', 0, 4, 1482476600, 0, 0, 1, 0, '奥林巴斯-E-330', '腾龙-14 F2.8', ' 海外- 瑞士', '/upload/2016-12-23/300RSfCzkVAjLe6f7hKgs9iMcouiyoEvztr.jpg', 0),
(16, '泰国寺庙！~', '', 0, 2, 1482476673, 0, 0, 1, 0, '尼康-D4000', '三星-10-17 F3.5-4.5', ' 海外- 泰国', '/upload/2016-12-23/300JelUV9hGK0Q6Lz7ZInEckO-jyscK-fgw.jpg', 0),
(17, '毕业旅行！~', '', 0, 12, 1482476742, 1, 0, 1, 0, '佳能-EOS 50D', '佳能-50 F1.8 ', ' 海外- 英国', '/upload/2016-12-23/3002VfRk320QnGiTNlGq0avAbyiuB5nIdgu.jpg', 0),
(18, '青海湖！~', '', 0, 14, 1482477009, 0, 0, 2, 0, '尼康-Coolpix P4', '奥林巴斯-9-18 F4-5.6', ' 青海- 海西', '/upload/2016-12-23/300T4m-cLehckrJATr2TygGDMQaTi8_i8QF.jpg', 0),
(19, '鹿！~', '', 0, 15, 1482477424, 1, 0, 2, 0, '佳能-EOS 350D', '三星-16-45 F4', ' 海外- 日本', '/upload/2016-12-23/300FY7e6Hz7IHTfaPI5aQcs9r6P_2vZ1Kzu.jpg', 0),
(20, '斗牛犬！~', '', 0, 14, 1482477475, 1, 0, 2, 0, '索尼-a100', '腾龙-14 F2.8', ' 北京', '/upload/2016-12-23/300OTzgcwOMe3paTniXLoPUcBm9xVIl73Gq.jpg', 0),
(21, '喵星人', '', 0, 14, 1482477521, 1, 0, 2, 0, '佳能-EOS 2000D', '奥林巴斯-7-14 F4.0', ' 上海', '/upload/2016-12-23/300ApJDkZ1rG_thf-7R0wMH4PnK9dZHNRAm.jpg', 0),
(22, '狮子！~~~~', '', 0, 15, 1482477599, 1, 0, 2, 0, '尼康-D4000', '奥林巴斯-7-14 F4.0', ' 北京', '/upload/2016-12-23/300-YMcLtJNQlB_7vT6tRsRa_Ou_xax7I4e.jpg', 0),
(23, '喵星人2~！', '', 0, 14, 1482477689, 1, 0, 2, 0, '佳能-EOS 50D', '佳能-20-35 F3.5-4.5 USM', ' 四川- 乐山', '/upload/2016-12-23/300G41zZaE_Y6TfNjd_kwFj5rpZ1owhDr6k.jpg', 0),
(24, '小胖子！~', '', 0, 10, 1482478328, 1, 0, 3, 0, '佳能-EOS 5D Mark II', '佳能-50 F1.4 USM', ' 北京', '/upload/2016-12-23/300bWpMGyPxli_r_LT2YcGjylQM5_JwRrhV.jpg', 0),
(25, '玩耍~~~', '', 0, 10, 1482478407, 1, 0, 3, 0, '佳能-EOS 5D Mark II', '佳能-50 F1.4 USM', ' 北京', '/upload/2016-12-23/300kk8ppFuELw-vkxOwKciAptaIs4xdjx3Y.jpg', 0),
(26, '泡澡！~~~~', '', 0, 10, 1482478492, 1, 0, 3, 0, '佳能-EOS 5D Mark II', '佳能-50 F1.4 USM', ' 台湾', '/upload/2016-12-23/300pCSFSWlwqgTDpnC-tWbaUAH_wzBHj38P.jpg', 0),
(27, '哼哼！~~~', '', 0, 10, 1482478572, 1, 0, 3, 0, '佳能-EOS 5D Mark II', '佳能-50 F1.4 USM', ' 上海', '/upload/2016-12-23/300DrwqQ4lgX89Pe0lKskcjciV-RvNW1ULa.jpg', 4),
(28, '瑞士街景~', '', 0, 6, 1482479183, 1, 0, 3, 0, '佳能-EOS 5D Mark II', '佳能-24-105 F4L IS USM', ' 海外- 瑞士', '/upload/2016-12-23/300_kvTt8iZgsqWkBtkvdQY_4IVbC8psBP4.jpg', 2),
(29, '自拍~~', '啊哈哈', 0, 20, 1487682186, 0, 0, 4, 0, '索尼-a230', '奥林巴斯-8 F3.5', ' 北京', '/upload/2017-02-21/300ezs-5szdENn6CtCQxtPzoCL9ydlUitJM.jpg', 1);

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

--
-- 表的结构 `bg_image`
--

CREATE TABLE IF NOT EXISTS `bg_image` (
  `id` int(11) NOT NULL,
  `thumb` varchar(255) NOT NULL COMMENT '缩略图',
  `origin` varchar(255) NOT NULL COMMENT '原图',
  `type` enum('0','1') NOT NULL DEFAULT '0' COMMENT '背景类型(0=图片,1=纯色)'
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;

--
-- 转存表中的数据 `bg_image`
--

INSERT INTO `bg_image` (`id`, `thumb`, `origin`, `type`) VALUES
(1, '/images/2016121301.png', '/images/bg/2016121301.jpg', '0'),
(2, '/images/2016121302.png', '/images/bg/2016121302.jpg', '0'),
(3, '/images/2016121303.png', '/images/bg/2016121303.jpg', '0'),
(4, '/images/2016121304.png', '/images/bg/2016121304.jpg', '0'),
(5, '/images/2016121305.png', '/images/bg/2016121305.jpg', '0'),
(6, '/images/2016121306.png', '/images/bg/2016121306.jpg', '0'),
(7, '#f3f3f3', '#f3f3f3', '1'),
(8, '#666', '#666', '1'),
(9, '#000', '#000', '1'),
(10, '#2A8FBD', '#2A8FBD', '1'),
(11, '#7FAD4C', '#7FAD4C', '1'),
(12, '#D16762', '#D16762', '1');

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

--
-- 表的结构 `category`
--

CREATE TABLE IF NOT EXISTS `category` (
  `id` int(11) NOT NULL COMMENT '分类id',
  `cat_name` varchar(50) NOT NULL COMMENT '分类名称',
  `parent_id` int(11) NOT NULL COMMENT '父级分类'
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;

--
-- 转存表中的数据 `category`
--

INSERT INTO `category` (`id`, `cat_name`, `parent_id`) VALUES
(1, '人像', 0),
(2, '风景', 0),
(3, '婚纱', 0),
(4, '海外', 0),
(5, '人文', 0),
(6, '街头', 0),
(7, '展会', 0),
(8, 'LOMO', 0),
(9, '胶片', 0),
(10, '儿童', 0),
(11, '达物', 0),
(12, '静物', 0),
(13, '美食', 0),
(14, '宠物', 0),
(15, '动物', 0),
(16, '昆虫', 0),
(17, '植物', 0),
(18, '概念', 0),
(19, '其它', 0),
(20, '糖水', 1),
(21, '妆面', 1),
(22, '黑白', 1),
(23, '日系', 1),
(24, '其它', 1),
(27, '135正片', 9),
(28, '135负片', 9),
(29, '135黑白', 9),
(30, '120正片', 9),
(31, '120负片', 9),
(32, '120黑白', 9);

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

--
-- 表的结构 `comment`
--

CREATE TABLE IF NOT EXISTS `comment` (
  `id` int(11) NOT NULL,
  `content` varchar(255) DEFAULT NULL COMMENT '评论内容',
  `time` int(11) NOT NULL COMMENT '评论时间',
  `user_id` int(11) NOT NULL COMMENT '用户id',
  `album_id` int(11) NOT NULL COMMENT '相册id',
  `photo_id` int(11) NOT NULL DEFAULT '0' COMMENT '照片id'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- 表的结构 `follow_byfollow`
--

CREATE TABLE IF NOT EXISTS `follow_byfollow` (
  `id` int(11) NOT NULL,
  `follow_id` int(11) NOT NULL COMMENT '关注者',
  `byfollow_id` int(11) NOT NULL COMMENT '被关注者'
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- 转存表中的数据 `follow_byfollow`
--

INSERT INTO `follow_byfollow` (`id`, `follow_id`, `byfollow_id`) VALUES
(2, 4, 1);

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

--
-- 表的结构 `haha`
--

CREATE TABLE IF NOT EXISTS `haha` (
  `id` int(11) NOT NULL,
  `username` varchar(255) NOT NULL,
  `password` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- 表的结构 `like_bylike`
--

CREATE TABLE IF NOT EXISTS `like_bylike` (
  `id` int(11) NOT NULL,
  `like_user_id` int(11) NOT NULL COMMENT '赞的用户id',
  `bylike_user_id` int(11) NOT NULL COMMENT '被赞的用户id',
  `photo_id` int(11) NOT NULL DEFAULT '0' COMMENT '被赞的照片id'
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- 转存表中的数据 `like_bylike`
--

INSERT INTO `like_bylike` (`id`, `like_user_id`, `bylike_user_id`, `photo_id`) VALUES
(1, 1, 1, 1),
(2, 1, 1, 18);

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

--
-- 表的结构 `person_info`
--

CREATE TABLE IF NOT EXISTS `person_info` (
  `id` int(11) NOT NULL,
  `nickname` varchar(30) NOT NULL COMMENT '昵称',
  `head_img` varchar(255) DEFAULT '/upload/headImg/default.png' COMMENT '头像',
  `live_address` varchar(50) DEFAULT NULL COMMENT '居住地',
