/*
Navicat MySQL Data Transfer

Source Server         : localhost
Source Server Version : 50540
Source Host           : localhost:3306
Source Database       : mocuz

Target Server Type    : MYSQL
Target Server Version : 50540
File Encoding         : 65001

Date: 2016-11-23 14:22:53
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for topic
-- ----------------------------
DROP TABLE IF EXISTS `mocuz_card_topic`;
CREATE TABLE `mocuz_card_topic` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '话题id',
`uid` varchar(50) NOT NULL DEFAULT 0 COMMENT '从云平台下发保存云平台话题id，用户创建保存用户uid，站长创建为0',
`username` varchar(50) NOT NULL DEFAULT 'admin' COMMENT '用户创建保存用户名，其他默认admin',
`title` varchar(40) NOT NULL COMMENT '标题',
`typeid` tinyint(3) NOT NULL DEFAULT 0 COMMENT '话题类型id（弃用）',
`listimg` varchar(100)  NOT NULL COMMENT '列表图片',
`detailimg` varchar(100)  NOT NULL COMMENT '封面图片',
`sourceid` tinyint(1) NOT NULL COMMENT '1站长自建  2云话题 3用户自建',
`buzzcount` int(11) NOT NULL DEFAULT 0 COMMENT '人气',
`concerncount` int(11) NOT NULL DEFAULT 0 COMMENT '关注人数',
`involcount` int(11) NOT NULL DEFAULT 0 COMMENT '参与人数',
`extracount` int(11) NOT NULL DEFAULT 0 COMMENT '页面显示人气',
`piccount` int(11) NOT NULL DEFAULT 0 COMMENT '话题图片数',
`isrec` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否推荐  0 否  1 是',
`istop` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否置顶  0 否  1 是',
`isdelete` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除  0 否  1 是',
`createtime` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
PRIMARY KEY (`id`),
INDEX(`title`)
)ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `mocuz_card_post`;
CREATE TABLE `mocuz_card_post` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` varchar(50) NOT NULL DEFAULT 0 COMMENT '用户创建保存用户uid，站长创建为0',
`username` varchar(50) NOT NULL DEFAULT 'admin' COMMENT '用户创建保存用户名，其他默认admin',
`content` varchar(400) NOT NULL COMMENT '帖子内容',
`platform` varchar(10)  NOT NULL DEFAULT 'ios' COMMENT '发帖客户端类型',
`sourceid` tinyint(1) NOT NULL COMMENT '1站长创建  2用户自建',
`status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '审核状态，0未审核',
`responsecount` int(11) NOT NULL DEFAULT 0 COMMENT '回复人数',
`likecount` int(11) NOT NULL DEFAULT 0 COMMENT '点赞数',
`readcount` int(11) NOT NULL DEFAULT 0 COMMENT '帖子浏览量',
`isdelete` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除  0 否  1 是',
`createtime` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
PRIMARY KEY (`id`),
INDEX(`uid`),
INDEX(`readcount`)
)ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `mocuz_card_post_img`;
CREATE TABLE `mocuz_card_post_img` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`postid` int(11) NOT NULL COMMENT '帖子ID',
`width` int(4) NOT NULL COMMENT '图片宽度',
`height` int(4) NOT NULL COMMENT '图片高度',
`path` varchar(100)  NOT NULL COMMENT '帖子图片地址，缩略图加_small',
`isdelete` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除  0 否  1 是',
`createtime` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
PRIMARY KEY (`id`),
INDEX(`postid`)
)ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `mocuz_card_topic_post`;
CREATE TABLE `mocuz_card_topic_post` (
`tid` int(11) NOT NULL COMMENT '话题ID',
`pid` int(11) NOT NULL COMMENT '帖子ID',
`createtime` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
INDEX(`tid`),
INDEX(`pid`)
)ENGINE=MyISAM DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `mocuz_card_comment`;
CREATE TABLE `mocuz_card_comment` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` varchar(50) NOT NULL DEFAULT 0 COMMENT '用户创建保存用户uid，站长创建为0',
`username` varchar(50) NOT NULL DEFAULT 'admin' COMMENT '用户创建保存用户名，其他默认admin',
`content` varchar(255) NOT NULL COMMENT '帖子内容',
`postid` int(11) NOT NULL COMMENT '帖子ID',
`to_uid` varchar(50) NULL DEFAULT 0 COMMENT '回复对象用户ID',
`to_username` varchar(50) NULL DEFAULT 0 COMMENT '回复对象用户名',
`status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '审核状态，0未审核',
`likecount` int(11) NOT NULL DEFAULT 0 COMMENT '点赞数',
`isdelete` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除  0 否  1 是',
`createtime` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
PRIMARY KEY (`id`),
INDEX(`postid`)
)ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `mocuz_card_topic_participation`;
CREATE TABLE `mocuz_card_topic_participation` (
`tid` int(11) NOT NULL COMMENT '话题ID',
`uid` varchar(50) NOT NULL,
`username` varchar(50) NOT NULL,
`createtime` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`tid`, `uid`)
)ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `mocuz_card_post_like`;
CREATE TABLE `mocuz_card_post_like` (
`postid` int(11) NOT NULL COMMENT '帖子ID',
`uid` varchar(50) NOT NULL DEFAULT 0,
`username` varchar(50) NOT NULL,
`createtime` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`postid`, `uid`)
)ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `mocuz_card_comment_like`;
CREATE TABLE `mocuz_card_comment_like` (
`commentid` int(11) NOT NULL COMMENT '评论/回复ID',
`uid` varchar(50) NOT NULL DEFAULT 0,
`username` varchar(50) NOT NULL,
`createtime` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`commentid`, `uid`)
)ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `mocuz_card_follow`;
CREATE TABLE `mocuz_card_follow` (
`uid` varchar(50) NOT NULL COMMENT '关注用户ID',
`fuid` varchar(50) NOT NULL COMMENT '被关注用户ID，好友ID',
`fusername` varchar(50) NOT NULL COMMENT '被关注用户名称',
`createtime` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
PRIMARY KEY (`uid`, `fuid`)
)ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `mocuz_card_keywords`;
CREATE TABLE `mocuz_card_keywords` (
	`id` INT(10) NOT NULL AUTO_INCREMENT,
	`keyword` VARCHAR(50) NOT NULL,
	`createtime` INT(11) NOT NULL,
	`isdelete` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '是否删除  0 否  1 是',
	PRIMARY KEY (`id`)
)
COMMENT='关键字表'
COLLATE='utf8_general_ci'
ENGINE=MyISAM
;
DROP TABLE IF EXISTS `mocuz_card_news`;
CREATE TABLE `mocuz_card_news` (
	`id` INT(11) NOT NULL,
	`fid` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' COMMENT '模块ID(其实是bid)',
	`title` VARCHAR(200) NOT NULL COMMENT '新闻标题',
	`type` TINYINT(1) NOT NULL COMMENT '展现形式1：单图；2：多图',
	`pic` VARCHAR(500) NOT NULL COMMENT '图片地址',
	`isdelete` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '0没删除，1删除',
	`create_time` INT(11) NOT NULL COMMENT '创建时间',
	`pictype` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '来获取图片的地址格式',
	`ts_time` INT(11) NOT NULL COMMENT '推送时间',
	`top` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '0没置顶，1置顶',
	`views_differ` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '编辑的次数-discuz表中的浏览数',
	`old_views` INT(10) NOT NULL DEFAULT '0' COMMENT 'discuz表中的浏览数',
	PRIMARY KEY (`id`)
)
COMMENT='新闻表'
COLLATE='utf8_general_ci'
ENGINE=MyISAM
;

DROP TABLE IF EXISTS `mocuz_card_home_channel`;
CREATE TABLE `mocuz_card_home_channel` (
  `id` int(6) NOT NULL AUTO_INCREMENT,
  `cid` int(6) NOT NULL,
  `title` varchar(16) DEFAULT NULL,
  `goto_value` varchar(255) DEFAULT NULL,
  `icon` varchar(255) DEFAULT NULL,
  `requiredlogin` tinyint(1) NOT NULL DEFAULT '0',
  `ordernum` tinyint(2) DEFAULT 0,
  `flag` char(10) DEFAULT NULL COMMENT '右上角热帖',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `mocuz_card_discovery_channel`;
CREATE TABLE `mocuz_card_discovery_channel` (
`id` int(6) NOT NULL AUTO_INCREMENT,
  `cid` int(6) NOT NULL,
  `fid` tinyint(2) NOT NULL default 1,
  `title` varchar(16) DEFAULT NULL,
  `goto_value` varchar(255) DEFAULT NULL,
  `icon` varchar(255) DEFAULT NULL,
  `requiredlogin` tinyint(1) NOT NULL DEFAULT '0',
  `ordernum` tinyint(2) DEFAULT 0,
  `flag` char(10) DEFAULT NULL COMMENT '右上角热帖',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `mocuz_card_channel_floor`;
CREATE TABLE `mocuz_card_channel_floor` (
`id` int(6) NOT NULL AUTO_INCREMENT,
  `name` char(12) NOT NULL COMMENT '楼层名称',
  `ordernum` tinyint(2) DEFAULT 0,
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `mocuz_ommon_member_wechat_bind`;
CREATE TABLE `mocuz_ommon_member_wechat_bind` (
  `uid` varchar(50) NOT NULL,
  `openid` char(32) NOT NULL DEFAULT '',
  `wechatname` char(50) NOT NULL DEFAULT '',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0已绑定，1删除绑定',
  PRIMARY KEY (`uid`),
  UNIQUE KEY `openid` (`openid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `mocuz_member_password_status`;
CREATE TABLE `mocuz_member_password_status` (
  `uid` varchar(50) NOT NULL,
  `login_type` tinyint(1) unsigned NOT NULL COMMENT '2免密登录，3微信登录',
  `password_status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1未设置，2已设置',
  PRIMARY KEY (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of topic
-- ----------------------------
