/*
 Navicat Premium Data Transfer

 Source Server         : 10.10.6.200
 Source Server Type    : MySQL
 Source Server Version : 100412
 Source Host           : 10.10.6.200:22066
 Source Schema         : ds_auto_code_db

 Target Server Type    : MySQL
 Target Server Version : 100412
 File Encoding         : 65001

 Date: 14/05/2020 16:19:25
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_base_person
-- ----------------------------
DROP TABLE IF EXISTS `t_base_person`;
CREATE TABLE `t_base_person`  (
  `person_id` int(11) NOT NULL AUTO_INCREMENT,
  `person_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`person_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for t_proto_files
-- ----------------------------
DROP TABLE IF EXISTS `t_proto_files`;
CREATE TABLE `t_proto_files`  (
  `file_id` char(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '文件编码',
  `file_name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '文件名称',
  `file_path` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '文件路径',
  PRIMARY KEY (`file_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for t_proto_interface
-- ----------------------------
DROP TABLE IF EXISTS `t_proto_interface`;
CREATE TABLE `t_proto_interface`  (
  `interface_id` char(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '接口ID',
  `interface_name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '接口名称',
  `file_id` char(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '所在文件ID',
  `struct_id` char(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '结构体ID',
  PRIMARY KEY (`interface_id`) USING BTREE,
  INDEX `fk_t_proto_interface_t_proto_files_1`(`file_id`) USING BTREE,
  INDEX `fk_t_proto_interface_t_proto_struct_1`(`struct_id`) USING BTREE,
  CONSTRAINT `fk_t_proto_interface_t_proto_files_1` FOREIGN KEY (`file_id`) REFERENCES `t_proto_files` (`file_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_t_proto_interface_t_proto_struct_1` FOREIGN KEY (`struct_id`) REFERENCES `t_proto_struct` (`struct_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for t_proto_struct
-- ----------------------------
DROP TABLE IF EXISTS `t_proto_struct`;
CREATE TABLE `t_proto_struct`  (
  `struct_id` char(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `struct_name` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `file_id` char(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`struct_id`) USING BTREE,
  INDEX `fk_t_proto_struct_t_proto_files_1`(`file_id`) USING BTREE,
  CONSTRAINT `fk_t_proto_struct_t_proto_files_1` FOREIGN KEY (`file_id`) REFERENCES `t_proto_files` (`file_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '这个结构体表，是指入参，出参，查询参的结构体' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for t_proto_struct_parameter
-- ----------------------------
DROP TABLE IF EXISTS `t_proto_struct_parameter`;
CREATE TABLE `t_proto_struct_parameter`  (
  `struct_parameter_id` char(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '参数ID',
  `struct_parameter_name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '参数名称',
  `struct_parameter_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '参数类型',
  `struct_id` char(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '结构体ID',
  `is_repeate` int(255) NOT NULL DEFAULT 0 COMMENT '是否是数组',
  PRIMARY KEY (`struct_parameter_id`) USING BTREE,
  INDEX `fk_t_proto_parameter_t_proto_struct_1`(`struct_id`) USING BTREE,
  CONSTRAINT `fk_t_proto_struct_parameter_t_proto_struct_1` FOREIGN KEY (`struct_id`) REFERENCES `t_proto_struct` (`struct_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for t_swagger_controller
-- ----------------------------
DROP TABLE IF EXISTS `t_swagger_controller`;
CREATE TABLE `t_swagger_controller`  (
  `controller_id` char(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '控制器ID',
  `controller_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '控制器名称',
  `interface_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'rpc proto中的interface name,用于扩展web controller,手动指定interfacename,默认和controllername一致',
  `http_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'get,post',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '接口描述',
  PRIMARY KEY (`controller_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for t_swagger_controller_parameter
-- ----------------------------
DROP TABLE IF EXISTS `t_swagger_controller_parameter`;
CREATE TABLE `t_swagger_controller_parameter`  (
  `controller_parameter_id` char(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '控制器参数ID',
  `controller_id` char(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '控制器ID',
  `controller_parameter_name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '参数名称',
  `is_required` int(11) NOT NULL COMMENT '是不是必须',
  `controller_parameter_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '参数类型int,string',
  `controller_parameter_get_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'query,formData',
  `controller_parameter_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '参数描述',
  PRIMARY KEY (`controller_parameter_id`) USING BTREE,
  INDEX `controller_id`(`controller_id`) USING BTREE,
  CONSTRAINT `fk_t_swagger_controller_parameter_t_swagger_controller_1` FOREIGN KEY (`controller_id`) REFERENCES `t_swagger_controller` (`controller_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
