/*
 Navicat Premium Data Transfer

 Source Server         : MariaDB
 Source Server Type    : MySQL
 Source Server Version : 100408
 Source Host           : 10.8.0.1:5201
 Source Schema         : tuonq_config

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

 Date: 21/07/2020 22:53:30
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for common_config
-- ----------------------------
DROP TABLE IF EXISTS `common_config`;
CREATE TABLE `common_config`  (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `property` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '属性KEY',
  `prop_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '属性值，可以是json字符，使用方自行决定',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '属性名称',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '属性描述，介绍',
  `application` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '应用名称，如果没有，则为公用的数据',
  `is_server` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否为服务端属性，如果是，则只有微服务能取到改数据，为否，则表示为前端网站',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`, `property`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '通用的配置表，这里一般为固定的数据，不会即时更新，需要客户端主动获取的配置信息；\r\n并且包含了微服务前端端，及通用的配置信息，后期可考虑针对某个角色，或者用户组' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for properties
-- ----------------------------
DROP TABLE IF EXISTS `properties`;
CREATE TABLE `properties`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '该配置的id',
  `key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '该配置的key值',
  `value` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '该资源的值',
  `application` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'application' COMMENT '该资源所属的应用，该字段表示所属的application，如果为空，则表示为通用配置',
  `profile` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'default' COMMENT '该资源的类别',
  `label` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'master' COMMENT '该资源的label',
  `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '该配置的人',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '该信息的创建时间',
  `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
  `update_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
  `desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '该信息的描述',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注信息',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'spring config 配置中心的数据库配置，不基于Git 做配置中心，这样更合理，能自己做更充分的配置' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of properties
-- ----------------------------
INSERT INTO `properties` VALUES (1, 'spring.dataSource.url', 'jdbc:mysql://192.168.42.1:5201/tuonq_config?useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull', 'config', 'dev', 'master', '', '2019-08-22 16:19:09', '', '2019-08-22 17:12:16', '配置中心数据库连接', NULL);
INSERT INTO `properties` VALUES (2, 'spring.dataSource', 'com.zaxxer.hikari.HikariDataSource', 'sys', 'dev', 'master', '', '2019-08-22 16:46:41', '', '2019-08-22 17:32:51', '数据库连接池类型，默认为HikariDataSource', NULL);
INSERT INTO `properties` VALUES (3, 'spring.dataSource.driver-class-name', 'com.mysql.jdbc.Driver', 'application', 'dev', 'master', '', '2019-08-22 16:50:06', NULL, '2019-08-23 14:17:53', '数据库驱动', NULL);
INSERT INTO `properties` VALUES (4, 'spring.dataSource.hikari.minimum-idle', '1', 'application', 'dev', 'master', '', '2019-08-22 16:50:31', '', '2019-08-23 14:18:01', '最小闲置连接数', NULL);
INSERT INTO `properties` VALUES (5, 'spring.dataSource.hikari.maximum-pool-size', '6', 'application', 'dev', 'master', '', '2019-08-22 16:50:41', '', '2019-08-23 14:18:03', '连接池最大连接数量', NULL);
INSERT INTO `properties` VALUES (6, 'spring.dataSource.hikari.auto-commit', 'true', 'application', 'dev', 'master', '', '2019-08-22 16:50:53', '', '2019-08-23 14:18:04', '忘记了是什么意思', NULL);
INSERT INTO `properties` VALUES (7, 'spring.dataSource.hikari.idle-timeout', '60000', 'application', 'dev', 'master', '', '2019-08-22 16:51:04', '', '2019-08-23 14:18:06', '最长闲置时间', NULL);
INSERT INTO `properties` VALUES (8, 'spring.dataSource.hikari.pool-name', 'DatebookHikariCP', 'application', 'dev', 'master', '', '2019-08-22 16:51:46', '', '2019-08-23 14:18:09', '数据库连接池名称，暂时不知道这个干嘛的', NULL);
INSERT INTO `properties` VALUES (10, 'spring.jta.log-dir', '.logs/${spring.application.name}/jta', 'application', 'default', 'master', '', '2019-08-23 15:35:21', NULL, '2019-08-23 14:18:24', '不知道这种写法，能不能实现', NULL);

-- ----------------------------
-- Table structure for property_label
-- ----------------------------
DROP TABLE IF EXISTS `property_label`;
CREATE TABLE `property_label`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id',
  `label` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '本级标签字段',
  `path` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '整个路径，以.分割，主要是为了适应配置中心数据库的key值',
  `p_id` int(10) NOT NULL DEFAULT 0 COMMENT '父级ID',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签简介',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注信息',
  `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '添加人',
  `create_time` datetime(0) NULL DEFAULT current_timestamp() COMMENT '添加时间',
  PRIMARY KEY (`id`, `path`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 22 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签，主要是用作提示，方便配置中心添加配置信息' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of property_label
-- ----------------------------
INSERT INTO `property_label` VALUES (1, 'spring', 'spring', 0, 'Spring', '春天花会开，鸟儿自由自在', NULL, NULL, '2019-08-10 02:33:10');
INSERT INTO `property_label` VALUES (2, 'dataSource', 'spring.dataSource', 1, '数据库配置项', '数据库配置项', NULL, NULL, '2019-08-10 02:39:16');
INSERT INTO `property_label` VALUES (4, 'username', 'spring.dataSource.username', 2, '数据库连接用户名', '数据库连接的用户名', NULL, NULL, '2019-08-11 04:07:38');
INSERT INTO `property_label` VALUES (7, 'password', 'spring.dataSource.password', 2, '密码', '密码，讲道理，密码不应该明文保存的', NULL, NULL, '2019-08-14 14:14:51');
INSERT INTO `property_label` VALUES (8, 'url', 'spring.dataSource.url', 2, '连接路径', '讲真，这个有点烦呀', NULL, NULL, '2019-08-14 14:20:35');
INSERT INTO `property_label` VALUES (9, 'redis', 'spring.redis', 1, 'redis缓存', 'redis 缓存父路径', NULL, NULL, '2019-08-14 14:22:00');
INSERT INTO `property_label` VALUES (10, 'user', 'spring.redis.user', 9, '用户名', '不知道是不是这个', NULL, NULL, '2019-08-14 14:22:36');
INSERT INTO `property_label` VALUES (11, 'password', 'spring.redis.password', 9, 'Redis密码', '密码，讲道理，密码不应该明文保存的', NULL, NULL, '2019-08-14 14:22:56');
INSERT INTO `property_label` VALUES (12, 'host', 'spring.redis.host', 9, '路径，主机名', '主机名', NULL, NULL, '2019-08-14 14:23:21');
INSERT INTO `property_label` VALUES (13, 'port', 'spring.redis.port', 9, '端口号，默认为6379', '端口号', NULL, NULL, '2019-08-14 14:23:55');
INSERT INTO `property_label` VALUES (14, 'rabbitmq', 'spring.rabbitmq', 1, 'rabbitmq', 'rabbitmq', NULL, NULL, '2019-08-22 07:55:21');
INSERT INTO `property_label` VALUES (15, 'jta', 'spring.jta', 1, 'jta', NULL, NULL, NULL, '2019-08-23 07:18:15');
INSERT INTO `property_label` VALUES (16, 'log-dir', 'spring.jta.log-dir', 15, '日志地址', 'jta分布式事务的日志', NULL, NULL, '2019-08-23 07:18:57');
INSERT INTO `property_label` VALUES (17, 'http', 'spring.http', 1, 'http', NULL, NULL, NULL, '2019-08-23 07:19:28');
INSERT INTO `property_label` VALUES (18, 'converters', 'spring.http.converters', 17, '转换器', '什么鬼', NULL, NULL, '2019-08-23 07:19:49');
INSERT INTO `property_label` VALUES (19, 'sentinel', 'spring.redis.sentinel', 9, '哨兵', '哨兵模式', NULL, NULL, '2019-08-25 02:40:05');
INSERT INTO `property_label` VALUES (20, 'master', 'spring.redis.sentinel.master', 19, 'redis主从名称', NULL, NULL, NULL, '2019-08-25 02:40:41');
INSERT INTO `property_label` VALUES (21, 'nodes', 'spring.redis.sentinel.nodes', 19, '哨兵配置', 'IP:PORT,多个用逗号隔开', NULL, NULL, '2019-08-25 02:42:05');

SET FOREIGN_KEY_CHECKS = 1;
