123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- ;
- ;
- ;
- ;
- ;
- ;
- ;
- ;
- ;
- ;
- CREATE DATABASE `goods_service` ;
- USE `goods_service`;
- DROP TABLE IF EXISTS `ad`;
- ;
- ;
- CREATE TABLE `ad` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(60) DEFAULT '',
- `image_url` varchar(255) DEFAULT '',
- `link` varchar(255) DEFAULT '',
- `sort_order` int(11) DEFAULT '10',
- `enable` tinyint(1) DEFAULT '1',
- `create` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- KEY `enable` (`enable`)
- ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
- ;
- DROP TABLE IF EXISTS `category`;
- ;
- ;
- CREATE TABLE `category` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(30) DEFAULT '',
- `parent_id` int(11) DEFAULT '0',
- `icon_url` varchar(255) DEFAULT '',
- `sort_order` int(11) DEFAULT '50',
- PRIMARY KEY (`id`),
- KEY `parent_id` (`parent_id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8mb4;
- ;
- DROP TABLE IF EXISTS `channel`;
- ;
- ;
- CREATE TABLE `channel` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(45) NOT NULL DEFAULT '',
- `url` varchar(255) NOT NULL DEFAULT '',
- `icon_url` varchar(255) NOT NULL DEFAULT '',
- `sort_order` int(4) unsigned NOT NULL DEFAULT '10',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4;
- ;
- DROP TABLE IF EXISTS `goods`;
- ;
- ;
- CREATE TABLE `goods` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `category_id` int(11) DEFAULT '0',
- `seller_id` varchar(32) DEFAULT '1',
- `buyer_id` varchar(32) DEFAULT '0',
- `name` varchar(100) DEFAULT '',
- `price` decimal(10,2) NOT NULL,
- `market_price` decimal(10,2) DEFAULT '0.00',
- `postage` decimal(10,2) DEFAULT '0.00',
- `primary_pic_url` varchar(255) DEFAULT '',
- `desc` text,
- `region_id` int(11) DEFAULT '403',
- `region` varchar(64) DEFAULT '北京 北京市 东城区',
- `want_count` int(11) DEFAULT '0',
- `browse_count` int(11) DEFAULT '0',
- `is_selling` tinyint(1) DEFAULT '1',
- `is_delete` tinyint(1) DEFAULT '0',
- `able_express` tinyint(1) DEFAULT '1',
- `able_meet` tinyint(1) DEFAULT '0',
- `able_self_take` tinyint(1) DEFAULT '0',
- `post_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `last_edit` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `sold_time` timestamp NULL DEFAULT NULL,
- PRIMARY KEY (`id`),
- KEY `category_id` (`category_id`),
- KEY `seller_id` (`seller_id`),
- KEY `buyer_id` (`buyer_id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8mb4;
- ;
- DROP TABLE IF EXISTS `goods_comment`;
- ;
- ;
- CREATE TABLE `goods_comment` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `goods_id` int(11) DEFAULT '0',
- `user_id` varchar(32) DEFAULT '1',
- `reply_comment_id` int(11) DEFAULT '0',
- `reply_user_id` varchar(32) DEFAULT '0',
- `content` text,
- `is_delete` tinyint(1) DEFAULT '0',
- `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- KEY `goods_id` (`goods_id`),
- KEY `reply_comment_id` (`reply_comment_id`),
- KEY `user_id` (`user_id`),
- KEY `reply_user_id` (`reply_user_id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4;
- ;
- DROP TABLE IF EXISTS `goods_gallery`;
- ;
- ;
- CREATE TABLE `goods_gallery` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `goods_id` int(11) DEFAULT '0',
- `img_url` varchar(255) DEFAULT '',
- PRIMARY KEY (`id`),
- KEY `goods_id` (`goods_id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=118 DEFAULT CHARSET=utf8mb4;
- ;
- DROP TABLE IF EXISTS `region`;
- ;
- ;
- CREATE TABLE `region` (
- `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
- `parent_id` smallint(5) unsigned NOT NULL DEFAULT '0',
- `name` varchar(120) NOT NULL DEFAULT '',
- `type` tinyint(1) NOT NULL DEFAULT '2',
- `agency_id` smallint(5) unsigned NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- KEY `parent_id` (`parent_id`),
- KEY `region_type` (`type`),
- KEY `agency_id` (`agency_id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=4044 DEFAULT CHARSET=utf8mb4;
- ;
- DROP TABLE IF EXISTS `search_history`;
- ;
- ;
- CREATE TABLE `search_history` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `user_id` varchar(32) DEFAULT '1',
- `keyword` varchar(65) DEFAULT '',
- `search_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- KEY `user_id` (`user_id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8mb4;
- ;
- DROP TABLE IF EXISTS `user_preference`;
- ;
- ;
- CREATE TABLE `user_preference` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `goods_id` int(11) DEFAULT '0',
- `user_id` varchar(32) DEFAULT '0',
- `type` int(1) DEFAULT '0' COMMENT '1:收藏,2:想要',
- `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- KEY `user_id` (`user_id`),
- KEY `type` (`type`),
- KEY `goods_id` (`goods_id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4;
- ;
- CREATE DATABASE `im_service` ;
- USE `im_service`;
- DROP TABLE IF EXISTS `chat`;
- ;
- ;
- CREATE TABLE `chat` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `u1` varchar(32) NOT NULL DEFAULT '',
- `u2` varchar(32) DEFAULT '' COMMENT 'u1 < u2',
- `goods_id` int(11) DEFAULT '0',
- `show_to_u1` tinyint(1) DEFAULT '1',
- `show_to_u2` tinyint(1) DEFAULT '1',
- PRIMARY KEY (`id`),
- KEY `u1` (`u1`),
- KEY `u2` (`u2`),
- KEY `goods_id` (`goods_id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4;
- ;
- DROP TABLE IF EXISTS `history`;
- ;
- ;
- CREATE TABLE `history` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `chat_id` int(11) DEFAULT '0',
- `u1_to_u2` tinyint(1) DEFAULT '0',
- `message_type` int(11) DEFAULT '1',
- `message_body` text,
- `send_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- KEY `chat_id` (`chat_id`),
- KEY `send_time` (`send_time`)
- ) ENGINE=InnoDB AUTO_INCREMENT=277 DEFAULT CHARSET=utf8mb4;
- ;
- CREATE DATABASE `user_service` ;
- USE `user_service`;
- DROP TABLE IF EXISTS `user`;
- ;
- ;
- CREATE TABLE `user` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `open_id` varchar(32) DEFAULT '0',
- `nick_name` varchar(32) DEFAULT '',
- `avatar_url` varchar(200) DEFAULT '',
- `gender` int(1) DEFAULT NULL,
- `country` varchar(16) DEFAULT NULL,
- `province` varchar(16) DEFAULT NULL,
- `city` varchar(16) DEFAULT NULL,
- `language` varchar(5) DEFAULT NULL,
- `register_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- UNIQUE KEY `user_open_id_uindex` (`open_id`),
- KEY `open_id` (`open_id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4;
- ;
- ;
- ;
- ;
- ;
- ;
- ;
- ;
- ;
|