-- MySQL dump 10.13  Distrib 5.7.20, for osx10.12 (x86_64)
--
-- Host: localhost    Database: test
-- ------------------------------------------------------
-- Server version	5.7.20

/*!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 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `p_course`
--

DROP TABLE IF EXISTS `p_course`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_course` (
  `id` varchar(255) NOT NULL COMMENT '课程id',
  `code` varchar(255) NOT NULL COMMENT '课程编码',
  `name` varchar(255) DEFAULT NULL COMMENT '名字, 标题加副标题',
  `cover_url` varchar(255) DEFAULT NULL COMMENT '封面图路径',
  `bg_url` varchar(255) DEFAULT NULL COMMENT '背景图路径',
  `cp_id` varchar(255) NOT NULL COMMENT '供应商id',
  `detail` varchar(2048) DEFAULT NULL COMMENT '详情介绍',
  `digest` varchar(1024) DEFAULT NULL COMMENT '简介',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `keyword` varchar(255) DEFAULT NULL COMMENT '关键词',
  `status` int(11) DEFAULT 0 COMMENT '状态',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `type` int(11) NOT NULL DEFAULT 0 COMMENT '课程类型',
  `sub_title` varchar(255) DEFAULT NULL COMMENT '副标题',
  `breadcrumb` varchar(255) DEFAULT NULL COMMENT '前端导航名',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_pi8eqa7cc3ljn2o65o63x8jac` (`code`),
  KEY `IDXpi8eqa7cc3ljn2o65o63x8jac` (`code`),
  KEY `IDXcpk52kya5c5ld5hjja8nmdjw` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `p_course_sub_relation`
--

DROP TABLE IF EXISTS `p_course_sub_relation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_course_sub_relation` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `course_id` varchar(255) NOT NULL COMMENT '课程id',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `sort` int(11) DEFAULT 0 COMMENT '课的排序字段',
  `status` int(11) DEFAULT 0 COMMENT '状态',
  `sub_id` varchar(255) NOT NULL COMMENT '子id',
  `type` int(11) DEFAULT 1 COMMENT '类型, unit:0, lesson:1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK5v6hhargw48g37vjeeyp66l21` (`course_id`,`sub_id`,`type`),
  KEY `IDX7ispnot8j0hq0cqmpp21oycyx` (`course_id`),
  KEY `IDXdwn838cc5lcbih2ud2qqkkde2` (`sub_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `p_course_support_relation`
--

DROP TABLE IF EXISTS `p_course_support_relation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_course_support_relation` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `course_id` varchar(255) NOT NULL COMMENT '课程id',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `sort` int(11) DEFAULT 0 COMMENT '配套的顺序',
  `status` int(11) DEFAULT 0 COMMENT '状态',
  `support_id` varchar(255) NOT NULL COMMENT '配套id',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UKeffo3iy2i00o22r2bbl860x4v` (`course_id`,`support_id`),
  KEY `IDXlpv1435ao6l0gg35ld7y7cikf` (`course_id`),
  KEY `IDXhkm8tkk0o4fgyi2vtulbf4cbe` (`support_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `p_courseware`
--

DROP TABLE IF EXISTS `p_courseware`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_courseware` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `code` varchar(255) NOT NULL COMMENT '课件编码',
  `cp_id` varchar(255) DEFAULT NULL COMMENT '提供商id',
  `digest` varchar(1024) DEFAULT NULL COMMENT '简介',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `resource_list` varchar(255) DEFAULT NULL COMMENT '资源id数组',
  `status` int(11) DEFAULT 0 COMMENT '状态',
  `category` varchar(255) DEFAULT NULL COMMENT '环节',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_hjqw4rqtjipshlpujf8w5h2oj` (`code`),
  KEY `IDXhjqw4rqtjipshlpujf8w5h2oj` (`code`),
  KEY `IDXcgiar2183htpkotrbvak0vqn6` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `p_courseware`
--

--
-- Table structure for table `p_goods`
--

DROP TABLE IF EXISTS `p_goods`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_goods` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `charge_unit` varchar(255) NOT NULL COMMENT '收费单位',
  `cp_price` decimal(19,2) NOT NULL COMMENT '供应商价格',
  `duration` int(11) NOT NULL COMMENT '使用时长',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `merchant_id` varchar(255) NOT NULL COMMENT '渠道id',
  `merchant_price` decimal(19,2) NOT NULL COMMENT '渠道价格',
  `pid` varchar(255) NOT NULL COMMENT '产品id',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  `terminal_price` decimal(19,2) NOT NULL COMMENT '终端价格',
  `type` int(11) NOT NULL COMMENT '商品类型',
  `cp_id` varchar(255) DEFAULT NULL COMMENT '供应商id',
  `pkg_id` varchar(255) DEFAULT NULL COMMENT '课程包id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `p_lesson`
--

DROP TABLE IF EXISTS `p_lesson`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_lesson` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `code` varchar(255) NOT NULL COMMENT '课编码',
  `digest` varchar(1024) DEFAULT NULL COMMENT '简介',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `title` varchar(255) DEFAULT NULL COMMENT '课标题',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_posinhfdd523n1lj6q17pa37w` (`code`),
  KEY `IDXposinhfdd523n1lj6q17pa37w` (`code`),
  KEY `IDX3nv68nb0pb0gdl2sqs9n3wbau` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `p_lesson_ware_relation`
--

DROP TABLE IF EXISTS `p_lesson_ware_relation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_lesson_ware_relation` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `lesson_id` varchar(255) NOT NULL COMMENT '课程id',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '顺序',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  `ware_id` varchar(255) NOT NULL COMMENT '课件id',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UKpfoxbd3c6oibmwhy5bf69oyk3` (`lesson_id`,`ware_id`),
  KEY `IDXhuv1t07rtuv0phdxsu7veuke3` (`lesson_id`),
  KEY `IDXs5tld49evn1ik6unrwihxahqe` (`ware_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `p_merchant_product`
--

DROP TABLE IF EXISTS `p_merchant_product`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_merchant_product` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `code` varchar(255) NOT NULL COMMENT '产品编码',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `merchant_id` varchar(255) NOT NULL COMMENT '渠道id',
  `name` varchar(255) DEFAULT NULL COMMENT 'title + sub_title',
  `pid` varchar(255) NOT NULL COMMENT '产品id',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序字段',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  `type` int(11) NOT NULL COMMENT '产品类型, 0:课程, 1:周边, 2:课程包',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UKnrxmjylij0spvxtfaiv199tgv` (`pid`,`merchant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `p_package`
--

DROP TABLE IF EXISTS `p_package`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_package` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `code` varchar(255) NOT NULL COMMENT '编码',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `name` varchar(255) DEFAULT NULL COMMENT '课程包名',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序字段',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `p_package_product_relation`
--

DROP TABLE IF EXISTS `p_package_product_relation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_package_product_relation` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `cp_price` decimal(19,2) NOT NULL COMMENT '供应商价格',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `pid` varchar(255) NOT NULL COMMENT '产品id',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '产品在课程包中顺序',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  `pkg_id` varchar(255) DEFAULT NULL COMMENT '课程包id',
  `merchant_price` decimal(19,2) NOT NULL COMMENT '渠道价格',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `p_product`
--

DROP TABLE IF EXISTS `p_product`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_product` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `code` varchar(255) NOT NULL COMMENT '产品编码',
  `cp_id` varchar(255) NOT NULL COMMENT '供应商id',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `name` varchar(255) DEFAULT NULL COMMENT '名字，title + sub_title',
  `pid` varchar(255) NOT NULL COMMENT '产品id',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  `type` int(11) NOT NULL COMMENT '0:课程,1:周边,2:课程包',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_a468qaphq6cwrlpmdj9j55aqh` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `p_product_tag_relation`
--

DROP TABLE IF EXISTS `p_product_tag_relation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_product_tag_relation` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `merchant_id` varchar(255) NOT NULL COMMENT '渠道id',
  `pid` varchar(255) NOT NULL COMMENT '产品id',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '产品在标签下的排序',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  `tag_id` varchar(255) NOT NULL COMMENT '标签id',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UKp6e67xki6xb94pkw5gd7uxksu` (`pid`,`tag_id`),
  KEY `IDXffw9iinfe9s57bu4w8vj8mxea` (`pid`),
  KEY `IDXagxlckh2sgyuk85s6owad5xf5` (`tag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `p_recommend`
--

DROP TABLE IF EXISTS `p_recommend`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_recommend` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `merchant_id` varchar(255) NOT NULL COMMENT '渠道id',
  `pid` varchar(255) NOT NULL COMMENT '产品id',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  `type` int(11) NOT NULL COMMENT '类型，同产品',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UKbmqbdstfqic8rrrrquywbywdn` (`merchant_id`,`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `p_support`
--

DROP TABLE IF EXISTS `p_support`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_support` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `code` varchar(255) NOT NULL COMMENT '编码',
  `cp_id` varchar(255) NOT NULL COMMENT '供应商id',
  `detail` varchar(2048) DEFAULT NULL COMMENT '周边介绍',
  `digest` varchar(2014) DEFAULT NULL COMMENT '简介',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `img_list` varchar(255) DEFAULT NULL COMMENT '图片相对路径数组',
  `name` varchar(255) DEFAULT NULL COMMENT '检索名字,title+sub_title',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `type` int(11) NOT NULL COMMENT '类型为1',
  `cover_url` varchar(255) DEFAULT NULL COMMENT '封面图相对路径',
  `sub_title` varchar(255) DEFAULT NULL COMMENT '副标题',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_2b6ofi8napjs60pmna6n5fqlj` (`code`),
  KEY `IDX2b6ofi8napjs60pmna6n5fqlj` (`code`),
  KEY `IDX6vxmfh271xpt5wwqgjpnfxhc` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `p_support_reference`
--

DROP TABLE IF EXISTS `p_support_reference`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_support_reference` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `fid` varchar(255) NOT NULL COMMENT '周边id',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  `tid` varchar(255) NOT NULL COMMENT '关联周边id',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UKga6v7pykm0vh3fj4c9lc5wn1y` (`fid`,`tid`),
  KEY `IDXb0id5ut567lxbn53nj90dv85p` (`fid`),
  KEY `IDXh1j8ki07w89hn99sjvtpbirq1` (`tid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `p_tag`
--

DROP TABLE IF EXISTS `p_tag`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_tag` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `group_id` varchar(255) NOT NULL COMMENT '标签组id',
  `merchant_id` varchar(255) NOT NULL COMMENT '渠道id',
  `name` varchar(255) DEFAULT NULL COMMENT '标签名',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UKetx8sn44o27yojm5d4d0fd93l` (`name`,`group_id`),
  KEY `IDXk97bmi9ssbd7u65hmv1dx4udc` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `p_tag_group`
--

DROP TABLE IF EXISTS `p_tag_group`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `p_tag_group` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `code` varchar(255) NOT NULL COMMENT '编码',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `merchant_id` varchar(255) NOT NULL COMMENT '渠道id',
  `name` varchar(255) DEFAULT NULL COMMENT '标签组名字',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK7qilc06klpv1opxqrk2ufbsoy` (`code`,`merchant_id`),
  UNIQUE KEY `UK_ga7ks6s5e8jo0536pd23en7u9` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `r_resource`
--

DROP TABLE IF EXISTS `r_resource`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `r_resource` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `code` varchar(255) DEFAULT NULL COMMENT '编码',
  `format` varchar(255) DEFAULT NULL COMMENT '格式',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `name` varchar(255) DEFAULT NULL COMMENT '名字',
  `path` varchar(255) DEFAULT NULL COMMENT '相对路径',
  `quality` varchar(255) DEFAULT NULL COMMENT '分辨率/码率',
  `size` bigint(20) DEFAULT NULL COMMENT '大小',
  `status` int(11) DEFAULT NULL COMMENT '状态',
  `type` int(11) DEFAULT NULL COMMENT '类型',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `t_order`
--

DROP TABLE IF EXISTS `t_order`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_order` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `address` varchar(1024) DEFAULT NULL COMMENT '收货地址',
  `adjust_price` decimal(19,2) NOT NULL COMMENT '调整价格',
  `final_price` decimal(19,2) NOT NULL COMMENT '成交价格',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `mobile` varchar(255) NOT NULL COMMENT '收货人手机号',
  `name` varchar(255) NOT NULL COMMENT '收货人姓名',
  `note` varchar(255) DEFAULT NULL COMMENT '备注',
  `origin_price` decimal(19,2) NOT NULL COMMENT '原始价格',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  `uid` varchar(255) NOT NULL COMMENT '终端账号id',
  `order_status` int(11) NOT NULL COMMENT '订单状态',
  `split_status` int(11) NOT NULL COMMENT '拆分状态',
  `merchant_id` varchar(255) NOT NULL COMMENT '渠道id',
  `serial_no` varchar(255) NOT NULL COMMENT '订单流水号',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `t_order_detail`
--

DROP TABLE IF EXISTS `t_order_detail`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_order_detail` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `address` varchar(1024) DEFAULT NULL COMMENT '收货地址',
  `adjust_price` decimal(19,2) NOT NULL COMMENT '调整价格',
  `final_price` decimal(19,2) NOT NULL COMMENT '成交价格',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `mobile` varchar(255) NOT NULL COMMENT '收货人手机号',
  `name` varchar(255) NOT NULL COMMENT '收货人姓名',
  `note` varchar(255) DEFAULT NULL COMMENT '备注',
  `order_id` varchar(255) NOT NULL COMMENT '母订单id',
  `origin_price` decimal(19,2) NOT NULL COMMENT '原始价格',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '有效状态',
  `track_no` varchar(255) DEFAULT NULL COMMENT '运单号',
  `uid` varchar(255) NOT NULL COMMENT '终端账号id',
  `cp_id` varchar(255) NOT NULL COMMENT '供应商id',
  `order_status` int(11) NOT NULL COMMENT '订单状态',
  `type` int(11) NOT NULL COMMENT '订单类型, 实物还是虚拟物品',
  `merchant_id` varchar(255) NOT NULL COMMENT '渠道id',
  `serial_no` varchar(255) NOT NULL COMMENT '子订单流水号',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `t_order_goods_relation`
--

DROP TABLE IF EXISTS `t_order_goods_relation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_order_goods_relation` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `detail_id` varchar(255) DEFAULT NULL COMMENT '子订单id',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `goods_id` varchar(255) NOT NULL COMMENT '商品id',
  `order_id` varchar(255) NOT NULL COMMENT '母订单id',
  `pid` varchar(255) NOT NULL COMMENT '产品id',
  `quantity` int(11) NOT NULL COMMENT '数量',
  `type` int(11) NOT NULL COMMENT '商品类型',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `t_order_product_snapshot`
--

DROP TABLE IF EXISTS `t_order_product_snapshot`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_order_product_snapshot` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `campus_code` varchar(255) DEFAULT NULL COMMENT '校区编码',
  `campus_id` varchar(255) DEFAULT NULL COMMENT '校区id',
  `campus_name` varchar(255) DEFAULT NULL COMMENT '校区名称',
  `charge_unit` varchar(255) DEFAULT NULL COMMENT '收费单位',
  `cp_id` varchar(255) DEFAULT NULL COMMENT '供应商id',
  `cp_name` varchar(255) DEFAULT NULL COMMENT '供应商名字',
  `cp_price` decimal(19,2) DEFAULT NULL COMMENT '供应商价格',
  `duration` int(11) DEFAULT NULL COMMENT '购买时长',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `goods_id` varchar(255) DEFAULT NULL COMMENT '商品id',
  `merchant_id` varchar(255) DEFAULT NULL COMMENT '渠道id',
  `merchant_name` varchar(255) DEFAULT NULL COMMENT '渠道名字',
  `merchant_price` decimal(19,2) DEFAULT NULL COMMENT '渠道价格',
  `order_id` varchar(255) DEFAULT NULL COMMENT '订单id',
  `pid` varchar(255) DEFAULT NULL COMMENT '产品id',
  `pkg_id` varchar(255) DEFAULT NULL COMMENT '课程包id',
  `product_code` varchar(255) DEFAULT NULL COMMENT '产品编码',
  `product_name` varchar(255) DEFAULT NULL COMMENT '产品名字',
  `product_type` int(11) DEFAULT NULL COMMENT '产品类型',
  `quantity` int(11) DEFAULT NULL COMMENT '购买数量',
  `status` int(11) DEFAULT NULL COMMENT '状态',
  `terminal_price` decimal(19,2) DEFAULT NULL COMMENT '终端价格',
  `uid` varchar(255) DEFAULT NULL COMMENT '终端账号id',
  `user_code` varchar(255) DEFAULT NULL COMMENT '终端账号',
  `user_name` varchar(255) DEFAULT NULL COMMENT '终端名',
  `detail_id` varchar(255) DEFAULT NULL COMMENT '子订单id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `u_buy_msg`
--

DROP TABLE IF EXISTS `u_buy_msg`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_buy_msg` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `goods_id` varchar(255) NOT NULL COMMENT '商品id',
  `pid` varchar(255) NOT NULL COMMENT '产品id',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  `user_id` varchar(255) NOT NULL COMMENT '用户id',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UKl0id8owrssftub1sba6bfraq9` (`user_id`,`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `u_campus`
--

DROP TABLE IF EXISTS `u_campus`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_campus` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `address` varchar(1024) DEFAULT NULL COMMENT '联系人地址',
  `bank_account` varchar(255) DEFAULT NULL COMMENT '银行账号',
  `city_name` varchar(255) DEFAULT NULL COMMENT '城市名字',
  `code` varchar(255) NOT NULL COMMENT '校区编码',
  `contact_name` varchar(255) DEFAULT NULL COMMENT '联系人姓名',
  `deposit_bank` varchar(255) DEFAULT NULL COMMENT '开户行',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `merchant_id` varchar(255) NOT NULL COMMENT '渠道id',
  `mobile` varchar(255) NOT NULL COMMENT '联系人电话',
  `name` varchar(255) DEFAULT NULL COMMENT '校区全名',
  `province_code` varchar(255) NOT NULL COMMENT '省份代码',
  `serial_no` int(11) NOT NULL COMMENT '校区流水号',
  `zone_name` varchar(255) DEFAULT NULL COMMENT '校区名',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK5eckl9gj2gpsxsta62kjxr3d0` (`merchant_id`,`serial_no`,`province_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `u_cms_user`
--

DROP TABLE IF EXISTS `u_cms_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_cms_user` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `avatar` varchar(255) DEFAULT NULL COMMENT '头像',
  `birthday` datetime DEFAULT NULL COMMENT '生日',
  `domain` int(11) NOT NULL COMMENT '平台类型',
  `gender` int(11) NOT NULL COMMENT '性别',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `is_admin` bit(1) DEFAULT NULL COMMENT '是否管理员',
  `mail` varchar(255) DEFAULT NULL COMMENT '邮箱',
  `merchant_id` varchar(255) NOT NULL COMMENT '渠道id',
  `mobile` varchar(255) DEFAULT NULL COMMENT '手机号',
  `name` varchar(255) NOT NULL COMMENT '名字',
  `nick_name` varchar(255) DEFAULT NULL COMMENT '昵称',
  `password` varchar(255) NOT NULL COMMENT '密码',
  `qq` varchar(255) DEFAULT NULL COMMENT 'qq',
  `status` int(11) DEFAULT NULL COMMENT '状态',
  `we_chat` varchar(255) DEFAULT NULL COMMENT '微信号',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_lo3xqm7dqacculpxd2korcbje` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `u_collection`
--

DROP TABLE IF EXISTS `u_collection`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_collection` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `pid` varchar(255) NOT NULL COMMENT '产品id',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  `type` int(11) NOT NULL COMMENT '类型',
  `user_id` varchar(255) NOT NULL COMMENT '终端账号id',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UKbhveykgms2jn8wo51hn0yn4wd` (`user_id`,`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `u_device`
--

DROP TABLE IF EXISTS `u_device`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_device` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `bind` bit(1) NOT NULL COMMENT '是否绑定账号',
  `brand` varchar(255) DEFAULT NULL COMMENT '终端品牌',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `ip` varchar(255) DEFAULT NULL COMMENT 'ip',
  `model_no` varchar(255) DEFAULT NULL COMMENT '型号',
  `status` int(11) DEFAULT NULL COMMENT '状态',
  `user_id` varchar(255) NOT NULL COMMENT '用户id',
  `device_code` varchar(255) NOT NULL COMMENT '终端唯一标识',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK5kl7vnchjhhk2xa6cv0qpb7ah` (`user_id`,`device_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `u_device_bind_log`
--

DROP TABLE IF EXISTS `u_device_bind_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_device_bind_log` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `brand` varchar(255) DEFAULT NULL COMMENT '品牌',
  `device_code` varchar(255) DEFAULT NULL COMMENT '终端唯一标识',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `ip` varchar(255) DEFAULT NULL COMMENT 'ip',
  `model_no` varchar(255) DEFAULT NULL COMMENT '型号',
  `status` int(11) DEFAULT NULL COMMENT '状态',
  `user_id` varchar(255) DEFAULT NULL COMMENT '终端账号id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `u_event_log`
--

DROP TABLE IF EXISTS `u_event_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_event_log` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `event_type` int(11) NOT NULL COMMENT '事件类型',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `merchant_id` varchar(255) DEFAULT NULL COMMENT '渠道id',
  `platform_type` int(11) DEFAULT NULL COMMENT '平台类型',
  `status` int(11) DEFAULT NULL COMMENT '状态',
  `tar_id` varchar(255) DEFAULT NULL COMMENT '操作对象id',
  `tar_name` varchar(255) DEFAULT NULL COMMENT '操作对象名称',
  `user_id` varchar(255) DEFAULT NULL COMMENT '用户id',
  `value` int(11) DEFAULT NULL COMMENT '事件的值',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `u_ledger`
--

DROP TABLE IF EXISTS `u_ledger`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_ledger` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `balance_after` decimal(19,2) NOT NULL COMMENT '变动前余额',
  `balance_before` decimal(19,2) NOT NULL COMMENT '变动后余额',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `merchant_id` varchar(255) DEFAULT NULL COMMENT '渠道id',
  `note` varchar(255) DEFAULT NULL COMMENT '备注',
  `quantity` decimal(19,2) NOT NULL COMMENT '变动数量',
  `receipt_id` varchar(255) DEFAULT NULL COMMENT '订单id',
  `type` int(11) NOT NULL COMMENT '类型',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `u_merchant`
--

DROP TABLE IF EXISTS `u_merchant`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_merchant` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `balance` decimal(19,2) NOT NULL COMMENT '余额',
  `bank_account` varchar(255) NOT NULL COMMENT '银行账号',
  `code` varchar(255) NOT NULL COMMENT '编码',
  `deposit_bank` varchar(255) NOT NULL COMMENT '开户行',
  `domain` int(11) NOT NULL COMMENT '平台类型',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `license_id` varchar(255) DEFAULT NULL COMMENT '营业执照编码',
  `name` varchar(255) DEFAULT NULL COMMENT '名字',
  `receipt_type` int(11) NOT NULL COMMENT '发票类型',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  `tax_number` varchar(255) DEFAULT NULL COMMENT '纳税人识别号',
  `contact_name` varchar(255) DEFAULT NULL COMMENT '联系人',
  `mobile` varchar(255) NOT NULL COMMENT '联系电话',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_7rsw4p31nynab5lcqki8pa0wv` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `u_operation_log`
--

DROP TABLE IF EXISTS `u_operation_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_operation_log` (
  `id` varchar(255) NOT NULL,
  `domain` int(11) DEFAULT NULL,
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ip` varchar(255) DEFAULT NULL,
  `merchant_id` varchar(255) DEFAULT NULL,
  `merchant_name` varchar(255) DEFAULT NULL,
  `method_name` varchar(255) DEFAULT NULL,
  `param_json` varchar(255) DEFAULT NULL,
  `request_url` varchar(255) DEFAULT NULL,
  `user_id` varchar(255) DEFAULT NULL,
  `user_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `u_resource`
--

DROP TABLE IF EXISTS `u_resource`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_resource` (
  `id` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `parent_id` varchar(255) DEFAULT NULL,
  `sort` int(11) DEFAULT NULL,
  `type` int(11) DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `u_role`
--

DROP TABLE IF EXISTS `u_role`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_role` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `admin` int(11) DEFAULT NULL,
  `code` varchar(255) DEFAULT NULL COMMENT '编码',
  `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间',
  `name` varchar(255) DEFAULT NULL COMMENT '名字',
  `status` int(11) DEFAULT NULL COMMENT '状态',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `u_role_resource_relation`
--

DROP TABLE IF EXISTS `u_role_resource_relation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_role_resource_relation` (
  `role_id` varchar(255) NOT NULL COMMENT '角色id',
  `resource_id` varchar(255) NOT NULL COMMENT '角色拥有权限资源id',
  KEY `FKb42yrc0i7ki8o4imsol4gm940` (`resource_id`),
  KEY `FKkfp8ny0jwmalx9kbbuj8o7o6j` (`role_id`),
  CONSTRAINT `FKb42yrc0i7ki8o4imsol4gm940` FOREIGN KEY (`resource_id`) REFERENCES `u_resource` (`id`),
  CONSTRAINT `FKkfp8ny0jwmalx9kbbuj8o7o6j` FOREIGN KEY (`role_id`) REFERENCES `u_role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `u_shop_cart`
--

DROP TABLE IF EXISTS `u_shop_cart`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_shop_cart` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `goods_id` varchar(255) NOT NULL COMMENT '商品id',
  `pid` varchar(255) NOT NULL COMMENT '产品id',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  `user_id` varchar(255) NOT NULL COMMENT '用户id',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UKrcjvb80k9hdqyv0malfw23br6` (`user_id`,`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `u_terminal_user`
--

DROP TABLE IF EXISTS `u_terminal_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_terminal_user` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `campus_id` varchar(255) NOT NULL COMMENT '校区id',
  `code` varchar(255) NOT NULL COMMENT '编码',
  `gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `merchant_id` varchar(255) NOT NULL COMMENT '渠道id',
  `name` varchar(255) DEFAULT NULL COMMENT '终端名, 如：教室一',
  `password` varchar(255) NOT NULL COMMENT '明文密码, 为了数据中心改密码',
  `serial_no` int(11) NOT NULL COMMENT '终端流水号',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
  `uid` varchar(255) NOT NULL COMMENT '用户原始id',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_ew3me2uw5xjfec3u5mhmm577x` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `u_user_role`
--

DROP TABLE IF EXISTS `u_user_role`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `u_user_role` (
  `id` varchar(255) NOT NULL COMMENT 'id',
  `role_id` varchar(255) DEFAULT NULL COMMENT 'role id',
  `user_id` varchar(255) DEFAULT NULL COMMENT 'user id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2018-03-26 17:20:23
