/*
 Navicat Premium Data Transfer

 Source Server         : 测试
 Source Server Type    : MariaDB
 Source Server Version : 100318
 Source Host           : test.tall.wiki:3306
 Source Schema         : plugin

 Target Server Type    : MariaDB
 Target Server Version : 100318
 File Encoding         : 65001

 Date: 25/07/2021 11:47:12
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_label
-- ----------------------------
DROP TABLE IF EXISTS `t_label`;
CREATE TABLE `t_label`  (
  `id` bigint(20) NOT NULL,
  `label_type_id` bigint(20) NULL DEFAULT 0 COMMENT '标签类型id',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '描述',
  `level` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '等级',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `label_type_id`(`label_type_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_label
-- ----------------------------

-- ----------------------------
-- Table structure for t_label_business
-- ----------------------------
DROP TABLE IF EXISTS `t_label_business`;
CREATE TABLE `t_label_business`  (
  `id` bigint(20) NOT NULL,
  `label_id` bigint(20) NULL DEFAULT 0 COMMENT '标签id',
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  `business_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '业务类型',
  `business_id` bigint(20) NULL DEFAULT 0 COMMENT '业务id（任务id、插件id、角色id等）',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `label_id`(`label_id`) USING BTREE,
  INDEX `user_id`(`user_id`) USING BTREE,
  INDEX `business_id`(`business_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签与业务关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_label_business
-- ----------------------------

-- ----------------------------
-- Table structure for t_label_type
-- ----------------------------
DROP TABLE IF EXISTS `t_label_type`;
CREATE TABLE `t_label_type`  (
  `id` bigint(20) NOT NULL,
  `label_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '标签类型',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '描述',
  `default_level` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '默认等级',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `label_type_index`(`label_type`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签类型表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_label_type
-- ----------------------------

-- ----------------------------
-- Table structure for t_pro_plugin
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_plugin`;
CREATE TABLE `t_pro_plugin`  (
  `id` bigint(20) NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '插件名称',
  `plugin_author` bigint(20) NULL DEFAULT 0 COMMENT '插件作者',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '简介（介绍插件功能和传参）',
  `version` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '版本号',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '插件表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_plugin
-- ----------------------------
INSERT INTO `t_pro_plugin` VALUES (1, '任务名', 11111, '111', 1, '2021-07-21 16:36:07', '2021-07-23 14:50:30', 0);
INSERT INTO `t_pro_plugin` VALUES (2, '', 0, '', 0, '2021-07-23 14:49:11', '2021-07-23 14:49:11', 0);
INSERT INTO `t_pro_plugin` VALUES (3, '', 0, '', 0, '2021-07-23 14:49:13', '2021-07-23 14:49:13', 0);
INSERT INTO `t_pro_plugin` VALUES (4, '', 0, '', 0, '2021-07-23 14:49:15', '2021-07-23 14:49:15', 0);
INSERT INTO `t_pro_plugin` VALUES (5, '', 0, '', 0, '2021-07-23 14:49:17', '2021-07-23 14:49:17', 0);
INSERT INTO `t_pro_plugin` VALUES (6, '', 0, '', 0, '2021-07-23 14:49:19', '2021-07-23 14:49:19', 0);
INSERT INTO `t_pro_plugin` VALUES (7, '', 0, '', 0, '2021-07-23 14:49:22', '2021-07-23 14:49:22', 0);
INSERT INTO `t_pro_plugin` VALUES (8, '', 0, '', 0, '2021-07-23 14:49:24', '2021-07-23 14:49:24', 0);
INSERT INTO `t_pro_plugin` VALUES (1001, '示例插件1', 0, '', 0, '2021-07-23 10:14:12', '2021-07-23 14:56:49', 0);
INSERT INTO `t_pro_plugin` VALUES (1002, '示例插件2', 0, '', 0, '2021-07-23 10:28:24', '2021-07-23 10:29:07', 0);
INSERT INTO `t_pro_plugin` VALUES (1003, '示例插件3', 0, '', 0, '2021-07-23 10:29:01', '2021-07-23 10:29:10', 0);

-- ----------------------------
-- Table structure for t_pro_plugin_style
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_plugin_style`;
CREATE TABLE `t_pro_plugin_style`  (
  `id` bigint(20) NOT NULL,
  `plugin_id` bigint(20) NULL DEFAULT 0 COMMENT '插件id',
  `style_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '页面样式内容（html css）',
  `js_function` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'js功能',
  `style_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '样式类型0:一行1:两行2:半屏',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `plugin_id`(`plugin_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '插件样式表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_plugin_style
-- ----------------------------
INSERT INTO `t_pro_plugin_style` VALUES (1, 1, '<div></div>', '', 0, '2021-07-21 15:42:34', '2021-07-23 17:57:03', 0);
INSERT INTO `t_pro_plugin_style` VALUES (2, 2, '', '', 0, '2021-07-13 15:43:11', '2021-07-23 14:50:50', 0);
INSERT INTO `t_pro_plugin_style` VALUES (3, 3, '', '', 0, '2021-07-23 14:49:37', '2021-07-23 14:50:11', 0);
INSERT INTO `t_pro_plugin_style` VALUES (4, 4, '', '', 0, '2021-07-23 14:49:51', '2021-07-23 14:50:15', 0);
INSERT INTO `t_pro_plugin_style` VALUES (5, 5, '', '', 0, '2021-07-23 14:49:55', '2021-07-23 14:50:15', 0);
INSERT INTO `t_pro_plugin_style` VALUES (6, 6, '', '', 0, '2021-07-23 14:50:00', '2021-07-23 14:50:15', 0);
INSERT INTO `t_pro_plugin_style` VALUES (7, 7, '', '', 0, '2021-07-23 14:50:02', '2021-07-23 14:50:15', 0);
INSERT INTO `t_pro_plugin_style` VALUES (8, 8, '', '', 0, '2021-07-23 14:50:04', '2021-07-23 14:50:15', 0);
INSERT INTO `t_pro_plugin_style` VALUES (1001, 1001, '<div style=\"height:100%;background:rgba(252, 211, 77,0.6)\" ></div>', '', 0, '2021-07-23 10:14:00', '2021-07-23 10:29:25', 0);
INSERT INTO `t_pro_plugin_style` VALUES (1002, 1002, '<button class=\"bg-blue-500 py-2 px-5 rounded text-white\" onclick=\"alert(\'hello\')\">测试组建1</button>', '', 0, '2021-07-23 10:29:32', '2021-07-23 10:29:53', 0);
INSERT INTO `t_pro_plugin_style` VALUES (1003, 1003, '<button class=\"bg-blue-500 py-2 px-5 rounded text-white\" onclick=\"p100.show()\">测试组建2</button>', 'const p100 = {\r\n                name: \'hello tall plugin\',\r\n                show() {\r\n                  alert(this.name)\r\n                }\r\n              }', 0, '2021-07-23 10:29:36', '2021-07-23 11:49:53', 0);
INSERT INTO `t_pro_plugin_style` VALUES (1004, 1003, '', '', 1, '2021-07-23 17:38:05', '2021-07-25 09:52:51', 0);

SET FOREIGN_KEY_CHECKS = 1;
