USE `{dataname}`;
Set character_set_connection=utf8, character_set_results=utf8, character_set_client=utf8;
CREATE TABLE IF NOT EXISTS `{tableprefix}admin` (  `uid` int(11) NOT NULL AUTO_INCREMENT,  `username` varchar(32) NOT NULL,  `usertype` char(10) NOT NULL,  `email` varchar(32) NOT NULL,  `passwd` varchar(32) NOT NULL,  PRIMARY KEY (`uid`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `{tableprefix}board` (  `board_id` int(11) NOT NULL AUTO_INCREMENT,  `user_id` int(11) NOT NULL,  `title` varchar(50) NOT NULL,  `description` varchar(200) NOT NULL,  `category_id` varchar(20) NOT NULL,  `category_name` varchar(32) NOT NULL,  `seq` int(3) NOT NULL,  `pin_count` int(11) NOT NULL,  `follow_count` int(11) NOT NULL,  `created_at` int(11) NOT NULL,  `updated_at` int(11) NOT NULL,  `is_private` tinyint(1) NOT NULL,  PRIMARY KEY (`board_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `{tableprefix}catelist` (  `id` int(2) NOT NULL AUTO_INCREMENT,  `cateindex` varchar(20) NOT NULL,  `catename` varchar(32) NOT NULL,  `categroup` varchar(20) NOT NULL,  `sortorder` int(5) DEFAULT '0',  `parentid` int(11) NOT NULL DEFAULT '0',  `recommend` tinyint(1) NOT NULL DEFAULT '0',  `othername` varchar(32) NOT NULL,  `layer` char(50) NOT NULL,  `keywords` varchar(200) NOT NULL,  `level` int(5) NOT NULL DEFAULT '0',  `customurl` varchar(50) NOT NULL,  PRIMARY KEY (`id`)) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COMMENT='商品分类表' AUTO_INCREMENT=79 ;
CREATE TABLE IF NOT EXISTS `{tableprefix}comments` (  `comment_id` int(11) NOT NULL AUTO_INCREMENT,  `pin_id` int(11) NOT NULL,  `user_id` int(11) NOT NULL,  `raw_text` varchar(200) NOT NULL,  `text_meta` varchar(32) NOT NULL,  `created_at` int(11) NOT NULL,  PRIMARY KEY (`comment_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `{tableprefix}commodity` (  `commodity_id` int(11) NOT NULL AUTO_INCREMENT,  `pin_id` int(11) NOT NULL,  `user_id` int(11) NOT NULL,  `board_id` int(11) NOT NULL,  `title` varchar(100) NOT NULL,  `link` varchar(50) NOT NULL,  `store` varchar(32) NOT NULL,  `price` varchar(8) NOT NULL,  `selling` tinyint(1) NOT NULL,  PRIMARY KEY (`commodity_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `{tableprefix}commodity_extra` (  `commodity_id` int(11) NOT NULL,  `outer_id` varchar(32) NOT NULL,  `created` varchar(32) NOT NULL,  `modified` varchar(32) NOT NULL,  `price` varchar(8) NOT NULL,  `properties` varchar(32) NOT NULL,  `properties_name` varchar(100) NOT NULL,  `quantity` varchar(32) NOT NULL,  `sku_id` varchar(20) NOT NULL,  `click_url` varchar(300) NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `{tableprefix}feeds` (  `feed_id` int(11) NOT NULL AUTO_INCREMENT,  `user_id` int(11) NOT NULL,  `created_at` int(11) NOT NULL,  `feedtype` varchar(10) NOT NULL,  `feedpid` int(11) NOT NULL,  PRIMARY KEY (`feed_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `{tableprefix}file` (  `file_id` int(11) NOT NULL AUTO_INCREMENT,  `bidcms_key` varchar(60) NOT NULL,  `bidcms_type` varchar(20) NOT NULL,  `width` int(4) NOT NULL,  `height` int(4) NOT NULL,  `isused` tinyint(1) NOT NULL,  PRIMARY KEY (`file_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `{tableprefix}notice_board` (  `notice_id` int(11) NOT NULL AUTO_INCREMENT,  `user_id` int(11) NOT NULL,  `board_id` int(11) NOT NULL,  `follow` tinyint(4) NOT NULL,  `mylike` tinyint(4) NOT NULL,  PRIMARY KEY (`notice_id`),  KEY `user_id` (`user_id`),  KEY `board_id` (`board_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `{tableprefix}notice_pin` (  `notice_id` int(11) NOT NULL AUTO_INCREMENT,  `user_id` int(11) NOT NULL,  `pin_id` int(11) NOT NULL,  `follow` tinyint(4) NOT NULL,  `mylike` tinyint(4) NOT NULL,  PRIMARY KEY (`notice_id`),  KEY `user_id` (`user_id`),  KEY `pin_id` (`pin_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `{tableprefix}pin` (  `pin_id` int(11) NOT NULL AUTO_INCREMENT,  `user_id` int(11) NOT NULL,  `board_id` int(11) NOT NULL,  `file_id` int(11) NOT NULL,  `cate` int(11) NOT NULL,  `via` int(11) NOT NULL DEFAULT '0' COMMENT '转采id',  `via_user_id` int(11) NOT NULL DEFAULT '0' COMMENT '转采者id',  `via_client` varchar(32) NOT NULL,  `original` int(11) NOT NULL DEFAULT '0' COMMENT '最初来源',  `orig_source` varchar(100) NOT NULL COMMENT '最初的图片地址',  `like_count` int(11) NOT NULL,  `comment_count` int(11) NOT NULL,  `repin_count` int(11) NOT NULL,  `is_private` tinyint(1) NOT NULL,  `source` varchar(50) NOT NULL COMMENT '原网站',  `link` varchar(100) NOT NULL COMMENT '原链接地址',  `raw_text` varchar(200) NOT NULL,  `text_meta` varchar(200) NOT NULL,  `media_type` tinyint(2) NOT NULL,  `created_at` int(11) NOT NULL,  `level` varchar(10) NOT NULL,  `keywords` varchar(100) NOT NULL,  PRIMARY KEY (`pin_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `{tableprefix}promotion` (  `promotion_id` int(11) NOT NULL AUTO_INCREMENT,  `promotion_item` varchar(32) NOT NULL,  `promotion_type` int(4) NOT NULL,  `promotion_url` varchar(50) NOT NULL,  `open_in_new_tab` tinyint(1) NOT NULL,  `category` varchar(200) NOT NULL,  `show_icon` varchar(32) NOT NULL,  `enabled` tinyint(1) NOT NULL,  `position` int(4) NOT NULL,  `title` varchar(32) NOT NULL,  `description` varchar(200) NOT NULL,  `seq` int(5) NOT NULL,  `file_id` int(11) NOT NULL,  `user_id` int(11) NOT NULL,  PRIMARY KEY (`promotion_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `{tableprefix}setting` (  `variable` varchar(32) NOT NULL,  `content` text NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='系统设置表';
CREATE TABLE IF NOT EXISTS `{tableprefix}user` (  `user_id` int(11) NOT NULL AUTO_INCREMENT,  `username` varchar(32) NOT NULL,  `email` varchar(32) NOT NULL,  `passwd` varchar(32) NOT NULL,  `urlname` varchar(32) NOT NULL,  `created_at` int(11) NOT NULL,  `avatar_id` int(11) NOT NULL,  `location` varchar(100) NOT NULL,  `board_count` int(11) NOT NULL,  `pin_count` int(11) NOT NULL,  `like_count` int(11) NOT NULL,  `follower_count` int(11) NOT NULL,  `following_count` int(11) NOT NULL,  `following` tinyint(1) NOT NULL,  `roles` varchar(10) NOT NULL,  `rating` int(11) NOT NULL,  PRIMARY KEY (`user_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `{tableprefix}user_bind` (  `bind_id` int(11) NOT NULL AUTO_INCREMENT,  `user_id` int(11) NOT NULL,  `service_name` varchar(32) NOT NULL,  `bind_user_id` int(11) NOT NULL,  `bind_user` varchar(50) NOT NULL,  `bind_email` varchar(32) NOT NULL,  `avatar_id` int(11) NOT NULL,  `created_at` int(11) NOT NULL,  `token` varchar(32) NOT NULL,  `tsercet` varchar(32) NOT NULL,  PRIMARY KEY (`bind_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `{tableprefix}user_profile` (  `user_id` int(11) NOT NULL,  `about` varchar(200) NOT NULL,  `url` varchar(50) NOT NULL,  `location` varchar(32) NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `{tableprefix}user_status` (  `user_id` int(11) NOT NULL,  `lr` int(11) NOT NULL COMMENT '最后登录',  `default_board` int(11) NOT NULL,  `invites` int(11) NOT NULL,  `share` int(11) NOT NULL,  `hide_douban` tinyint(1) NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `{tableprefix}setting` (`variable`, `content`) VALUES('site_logo', 'data/logo/logo.gif'),('site_cache_dir', 'data/cache'),('site_upload_dir', 'data/upload'),('site_email', 'bidcms@gmail.com'),('site_address', '山西省太原市'),('site_worktime', '09:00-23:00'),('site_qq', '253947468'),('site_benai', '晋ICP备001354号'),('site_tel', '15135096561'),('site_copyright', '版权归BidCms系统所有'),('seo_rewrite', '0'),('seo_title', 'BidCms图片分享系统，图片分享程序，开源图片分享，国内首家开源图片分享'),('seo_keyword', '图片分享系统，图片分享程序，开源图片分享'),('seo_description', '国内首家开源图片分享');