/*
 Navicat Premium Data Transfer

 Source Server         : localhost-mysql
 Source Server Type    : MySQL
 Source Server Version : 50732
 Source Host           : 127.0.0.1:3306
 Source Schema         : reghao_devops_rdb

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

 Date: 27/12/2021 18:04:19
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for app_building
-- ----------------------------
DROP TABLE IF EXISTS `app_building`;
CREATE TABLE `app_building` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `is_delete` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `build_by` varchar(255) DEFAULT NULL,
  `build_log_id` varchar(255) DEFAULT NULL,
  `build_result` varchar(255) NOT NULL,
  `build_time` datetime(6) DEFAULT NULL,
  `commit_id` varchar(255) DEFAULT NULL,
  `commit_time` datetime(6) DEFAULT NULL,
  `package_path` varchar(255) DEFAULT NULL,
  `app_config_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_6yldh4xvx55sfwx0vih4p74l4` (`app_config_id`),
  CONSTRAINT `FK9lsa0hnvjbqfxp33wkvwrq0ln` FOREIGN KEY (`app_config_id`) REFERENCES `app_config` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of app_building
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for app_config
-- ----------------------------
DROP TABLE IF EXISTS `app_config`;
CREATE TABLE `app_config` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `is_delete` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `app_id` varchar(64) NOT NULL,
  `app_name` varchar(255) NOT NULL,
  `app_repo` varchar(255) NOT NULL,
  `app_root_path` varchar(255) NOT NULL,
  `app_type` varchar(255) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `dockerfile` text,
  `env` varchar(255) NOT NULL,
  `exec_bin_name` varchar(255) DEFAULT NULL,
  `health_check` varchar(255) DEFAULT NULL,
  `http_port` int(11) DEFAULT NULL,
  `proj_dirname` varchar(255) NOT NULL,
  `repo_branch` varchar(255) NOT NULL,
  `compiler_config_id` int(11) NOT NULL,
  `packer_config_id` int(11) NOT NULL,
  `repo_auth_config_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_boipwfawtfve9o09lnb5le29a` (`app_id`)
) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of app_config
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for app_deploy_config
-- ----------------------------
DROP TABLE IF EXISTS `app_deploy_config`;
CREATE TABLE `app_deploy_config` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `is_delete` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `pack_type` varchar(255) NOT NULL,
  `start_home` varchar(255) DEFAULT NULL,
  `start_script` text NOT NULL,
  `unpack_script` text,
  `app_config_id` int(11) NOT NULL,
  `machine_host_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `FKhqgrewybinoowtbsbf63kf4pl` (`app_config_id`),
  KEY `FK7ionisohyo4pv58vwkkdugt35` (`machine_host_id`),
  CONSTRAINT `FK7ionisohyo4pv58vwkkdugt35` FOREIGN KEY (`machine_host_id`) REFERENCES `machine_host` (`id`),
  CONSTRAINT `FKhqgrewybinoowtbsbf63kf4pl` FOREIGN KEY (`app_config_id`) REFERENCES `app_config` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of app_deploy_config
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for app_deploying
-- ----------------------------
DROP TABLE IF EXISTS `app_deploying`;
CREATE TABLE `app_deploying` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `is_delete` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `build_log_id` varchar(255) DEFAULT NULL,
  `commit_id` varchar(255) DEFAULT NULL,
  `deploy_by` varchar(255) DEFAULT NULL,
  `deploy_result` varchar(255) NOT NULL,
  `deploy_time` datetime(6) DEFAULT NULL,
  `package_path` varchar(255) DEFAULT NULL,
  `app_deploy_config_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_qahn6tavk8skmp27vhi1pna17` (`app_deploy_config_id`),
  CONSTRAINT `FK2tkqafeq2bi3gi4ec4s113hj2` FOREIGN KEY (`app_deploy_config_id`) REFERENCES `app_deploy_config` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of app_deploying
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for app_monitor
-- ----------------------------
DROP TABLE IF EXISTS `app_monitor`;
CREATE TABLE `app_monitor` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `is_delete` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `app_build_id` int(11) DEFAULT NULL,
  `app_config_id` int(11) NOT NULL,
  `app_deploy_id` int(11) DEFAULT NULL,
  `app_health_check_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_p8g8asx4dnnqt1dlvlgf8c9rw` (`app_config_id`),
  KEY `FKmq2iryo1aai1eqmxy7q9ed77i` (`app_build_id`),
  KEY `FKf2ickc2ylt68wnl9sh3goaeva` (`app_deploy_id`),
  KEY `FKoicn3j9netc1st53wwb2j5mll` (`app_health_check_id`),
  CONSTRAINT `FKf2ickc2ylt68wnl9sh3goaeva` FOREIGN KEY (`app_deploy_id`) REFERENCES `notify_group` (`id`),
  CONSTRAINT `FKmq2iryo1aai1eqmxy7q9ed77i` FOREIGN KEY (`app_build_id`) REFERENCES `notify_group` (`id`),
  CONSTRAINT `FKoicn3j9netc1st53wwb2j5mll` FOREIGN KEY (`app_health_check_id`) REFERENCES `notify_group` (`id`),
  CONSTRAINT `FKqcktms0d2jc0m3iqjieuhqn4m` FOREIGN KEY (`app_config_id`) REFERENCES `app_config` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of app_monitor
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for app_running
-- ----------------------------
DROP TABLE IF EXISTS `app_running`;
CREATE TABLE `app_running` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `is_delete` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `last_check` datetime(6) DEFAULT NULL,
  `pid` int(11) DEFAULT NULL,
  `start_time` datetime(6) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `app_deploying_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_tqy0dk2oyqysje9g7s0ngh36g` (`app_deploying_id`),
  CONSTRAINT `FK2j1kmif6x371wgt3gbw7y825q` FOREIGN KEY (`app_deploying_id`) REFERENCES `app_deploying` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of app_running
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for build_dir
-- ----------------------------
DROP TABLE IF EXISTS `build_dir`;
CREATE TABLE `build_dir` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `is_delete` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `avail` varchar(255) NOT NULL,
  `dir_path` varchar(255) NOT NULL,
  `machine_id` varchar(255) NOT NULL,
  `machine_ipv4` varchar(255) NOT NULL,
  `mounted_on` varchar(255) NOT NULL,
  `total` varchar(255) NOT NULL,
  `used` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_hk1kw8yctt67349i4kaougm5e` (`machine_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of build_dir
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for compiler_config
-- ----------------------------
DROP TABLE IF EXISTS `compiler_config`;
CREATE TABLE `compiler_config` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `is_delete` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `compile_cmd` varchar(255) DEFAULT NULL,
  `home_path` varchar(255) DEFAULT NULL,
  `machine_id` varchar(255) NOT NULL,
  `machine_ipv4` varchar(255) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `type` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_8qb44ffa5pma9xekiphefr9sp` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of compiler_config
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for ding_account
-- ----------------------------
DROP TABLE IF EXISTS `ding_account`;
CREATE TABLE `ding_account` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `is_delete` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `notify_account_id` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `username` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of ding_account
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for machine_host
-- ----------------------------
DROP TABLE IF EXISTS `machine_host`;
CREATE TABLE `machine_host` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `is_delete` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `boot_time` bigint(20) NOT NULL,
  `env` varchar(255) NOT NULL,
  `last_check` bigint(20) NOT NULL,
  `machine_id` varchar(255) NOT NULL,
  `machine_ipv4` varchar(255) NOT NULL,
  `os_arch` varchar(255) NOT NULL,
  `os_name` varchar(255) NOT NULL,
  `os_version` varchar(255) NOT NULL,
  `ipv4` varchar(255) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  `rsa_prikey` text,
  `username` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_lo1x88vamyh2o34gdap4aw7jr` (`machine_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of machine_host
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for machine_info
-- ----------------------------
DROP TABLE IF EXISTS `machine_info`;
CREATE TABLE `machine_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `is_delete` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `arch` varchar(255) NOT NULL,
  `boot_time` bigint(20) NOT NULL,
  `byte_order` varchar(255) NOT NULL,
  `logical_core` int(11) NOT NULL,
  `machine_id` varchar(255) NOT NULL,
  `machine_ipv4` varchar(255) NOT NULL,
  `mem_total` bigint(20) NOT NULL,
  `model_name` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `physical_core` int(11) NOT NULL,
  `swap_total` bigint(20) DEFAULT NULL,
  `vendor` varchar(255) NOT NULL,
  `version` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_qtvbx85mqly0sgycqp1xt208s` (`machine_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of machine_info
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for machine_info_disk_infos
-- ----------------------------
DROP TABLE IF EXISTS `machine_info_disk_infos`;
CREATE TABLE `machine_info_disk_infos` (
  `machine_info_id` int(11) NOT NULL,
  `disk_path` varchar(255) DEFAULT NULL,
  `fs_type` varchar(255) DEFAULT NULL,
  `inode_total` bigint(20) DEFAULT NULL,
  `mounted_on` varchar(255) DEFAULT NULL,
  `total` bigint(20) DEFAULT NULL,
  KEY `FKjn32n1mvn6uuiqn0n6uwrqe2i` (`machine_info_id`),
  CONSTRAINT `FKjn32n1mvn6uuiqn0n6uwrqe2i` FOREIGN KEY (`machine_info_id`) REFERENCES `machine_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of machine_info_disk_infos
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for machine_info_network_infos
-- ----------------------------
DROP TABLE IF EXISTS `machine_info_network_infos`;
CREATE TABLE `machine_info_network_infos` (
  `machine_info_id` int(11) NOT NULL,
  `iface` varchar(255) DEFAULT NULL,
  `ipv4` varchar(255) DEFAULT NULL,
  `ipv6` varchar(255) DEFAULT NULL,
  `mac` varchar(255) DEFAULT NULL,
  `public_ipv4` varchar(255) DEFAULT NULL,
  KEY `FKfs6r0haxt8dx5ak8wp91pwojn` (`machine_info_id`),
  CONSTRAINT `FKfs6r0haxt8dx5ak8wp91pwojn` FOREIGN KEY (`machine_info_id`) REFERENCES `machine_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of machine_info_network_infos
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for menu
-- ----------------------------
DROP TABLE IF EXISTS `menu`;
CREATE TABLE `menu` (
  `id` int(11) NOT NULL,
  `create_time` datetime(6) DEFAULT NULL,
  `is_delete` bit(1) DEFAULT NULL,
  `update_time` datetime(6) DEFAULT NULL,
  `icon` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pid` int(11) DEFAULT NULL,
  `pos` int(11) DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_enabled` bit(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of menu
-- ----------------------------
BEGIN;
INSERT INTO `menu` VALUES (152, '2021-05-11 15:20:06.022212', b'0', '2021-07-21 11:46:59.271151', 'layui-icon layui-icon-home', 0, 1, '主页', 'page', '/home', b'1');
INSERT INTO `menu` VALUES (153, '2021-05-11 15:20:06.023637', b'0', '2021-09-17 10:47:19.830466', 'fa fa-cog', 0, 6, '系统管理', 'dir', '#', b'1');
INSERT INTO `menu` VALUES (154, '2021-05-11 15:20:06.040161', b'0', '2021-05-19 14:05:42.646522', 'layui-icon layui-icon-user\n', 9452, 3, '用户管理', 'page', '/rbac/user', b'1');
INSERT INTO `menu` VALUES (155, '2021-05-11 15:20:06.041503', b'0', '2021-05-11 15:20:06.041529', 'layui-icon layui-icon-release\n', 9452, 2, '角色管理', 'page', '/rbac/role', b'1');
INSERT INTO `menu` VALUES (156, '2021-05-11 15:20:06.042662', b'0', '2021-05-19 16:14:04.207084', 'layui-icon layui-icon-release\n', 9452, 1, '资源管理', 'page', '/rbac/menu', b'1');
INSERT INTO `menu` VALUES (302, '2021-05-13 10:31:09.179446', b'0', '2021-07-21 11:46:59.273299', 'layui-icon layui-icon-app', 0, 3, '应用', 'dir', '#', b'1');
INSERT INTO `menu` VALUES (303, '2021-05-13 10:34:32.400476', b'0', '2021-10-14 10:16:53.078797', 'layui-icon layui-icon-face-smile', 302, 3, '构建部署', 'page', '/app/bd', b'1');
INSERT INTO `menu` VALUES (305, '2021-05-13 10:38:19.945521', b'0', '2021-10-14 10:16:53.079793', 'layui-icon layui-icon-set', 302, 2, '应用配置', 'page', 'app/config/app', b'1');
INSERT INTO `menu` VALUES (502, '2021-05-17 18:08:58.040642', b'0', '2021-05-17 18:08:58.040717', 'layui-icon layui-icon-set', 302, 1, '构建配置', 'dir', '#', b'1');
INSERT INTO `menu` VALUES (503, '2021-05-17 18:10:42.043424', b'0', '2021-05-17 18:10:42.043453', 'layui-icon layui-icon-set', 502, 1, '构建目录', 'page', '/app/config/build/dir', b'1');
INSERT INTO `menu` VALUES (703, '2021-05-19 14:22:12.166310', b'0', '2021-07-12 11:14:59.899202', 'layui-icon layui-icon-release\n', 153, 1, '系统环境', 'page', '/sys/env', b'1');
INSERT INTO `menu` VALUES (704, '2021-05-19 14:22:22.845883', b'0', '2021-09-17 10:47:19.831765', 'layui-icon layui-icon-release', 1502, 1, '通知配置', 'dir', '#', b'1');
INSERT INTO `menu` VALUES (752, '2021-05-19 16:00:10.445920', b'0', '2021-07-12 11:14:59.900378', 'layui-icon layui-icon-release\n', 153, 2, 'JVM 状态', 'page', '/sys/jvmstatus', b'1');
INSERT INTO `menu` VALUES (802, '2021-05-20 13:44:18.715247', b'0', '2021-05-20 13:44:18.715323', 'layui-icon layui-icon-set', 502, 2, '仓库认证', 'page', '/app/config/build/repoauth', b'1');
INSERT INTO `menu` VALUES (803, '2021-05-20 13:44:42.119999', b'0', '2021-05-20 13:44:42.120040', 'layui-icon layui-icon-set', 502, 3, '应用编译', 'page', '/app/config/build/compiler', b'1');
INSERT INTO `menu` VALUES (804, '2021-05-20 13:45:11.729758', b'0', '2021-05-20 13:45:11.729792', 'layui-icon layui-icon-set', 502, 4, '应用打包', 'page', '/app/config/build/packer', b'1');
INSERT INTO `menu` VALUES (809, '2021-05-20 13:53:46.834540', b'0', '2021-10-20 18:03:24.299736', 'layui-icon layui-icon-face-smile', 302, 5, '应用状态', 'page', '/app/stat', b'1');
INSERT INTO `menu` VALUES (810, '2021-05-20 13:54:34.299197', b'0', '2021-07-21 11:46:59.275648', 'fa fa-server', 0, 2, '机器', 'dir', '#', b'1');
INSERT INTO `menu` VALUES (811, '2021-05-20 13:55:24.546804', b'0', '2021-05-20 13:55:24.546861', 'fa fa-server', 810, 1, '机器节点', 'page', '/machine/host', b'1');
INSERT INTO `menu` VALUES (1502, '2021-06-04 09:22:16.495701', b'0', '2021-09-17 10:47:19.832798', 'layui-icon layui-icon-face-smile', 0, 4, '监控报警', 'dir', '#', b'1');
INSERT INTO `menu` VALUES (1503, '2021-06-04 09:23:17.107389', b'0', '2021-06-04 09:23:17.107416', 'layui-icon layui-icon-face-smile', 1502, 2, '应用监控', 'page', '/monitor/app', b'1');
INSERT INTO `menu` VALUES (2252, '2021-06-11 10:47:25.635127', b'0', '2021-07-12 11:16:00.527986', 'layui-icon layui-icon-face-smile', 9502, 1, '运行日志', 'page', '/sys/log/runtime', b'1');
INSERT INTO `menu` VALUES (2253, '2021-06-11 10:48:03.515580', b'0', '2021-07-12 11:16:14.394649', 'layui-icon layui-icon-face-smile', 9502, 2, '访问日志', 'page', '/sys/log/access111', b'1');
INSERT INTO `menu` VALUES (6102, '2021-06-23 17:01:09.479385', b'0', '2021-06-23 17:01:09.479414', 'layui-icon layui-icon-face-smile', 704, 2, '通知组', 'page', '/monitor/notify/receiver', b'1');
INSERT INTO `menu` VALUES (6752, '2021-06-24 16:26:23.732725', b'0', '2021-10-27 13:40:24.809266', 'layui-icon layui-icon-face-smile', 704, 1, '钉钉账户', 'page', '/monitor/notify/ding', b'1');
INSERT INTO `menu` VALUES (9452, '2021-07-12 10:42:34.160548', b'0', '2021-09-17 10:47:19.833721', 'layui-icon layui-icon-face-smile', 0, 7, '权限用户', 'dir', '#', b'1');
INSERT INTO `menu` VALUES (9502, '2021-07-12 11:14:59.922658', b'0', '2021-07-12 11:14:59.922697', 'layui-icon layui-icon-face-smile', 153, 3, '日志', 'dir', '#', b'1');
INSERT INTO `menu` VALUES (13352, '2021-10-20 19:49:35.376482', b'0', '2021-10-20 19:49:35.376512', 'layui-icon layui-icon-face-smile', 302, 4, '构建部署日志', 'page', '/app/bd/log', b'1');
COMMIT;

-- ----------------------------
-- Table structure for notify_group
-- ----------------------------
DROP TABLE IF EXISTS `notify_group`;
CREATE TABLE `notify_group` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `is_delete` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `notify_account_id` varchar(255) NOT NULL,
  `notify_name` varchar(255) DEFAULT NULL,
  `notify_type` varchar(255) DEFAULT NULL,
  `receiver` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_gvaf84xd3bnxxf60r4whgv4e9` (`notify_account_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of notify_group
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for packer_config
-- ----------------------------
DROP TABLE IF EXISTS `packer_config`;
CREATE TABLE `packer_config` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `is_delete` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `binfiles_dirname` varchar(255) DEFAULT NULL,
  `machine_id` varchar(255) NOT NULL,
  `machine_ipv4` varchar(255) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `target_path` varchar(255) NOT NULL,
  `type` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_ilu7yfvuir3cvd8oqiemwrqh8` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of packer_config
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for repo_auth_config
-- ----------------------------
DROP TABLE IF EXISTS `repo_auth_config`;
CREATE TABLE `repo_auth_config` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `is_delete` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `auth_type` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `password` varchar(255) DEFAULT NULL,
  `rsa_prikey` text,
  `type` varchar(255) NOT NULL,
  `username` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_cfu57vn4gixedymokbkcnjpd0` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of repo_auth_config
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `id` int(11) NOT NULL,
  `create_time` datetime(6) DEFAULT NULL,
  `is_delete` bit(1) DEFAULT NULL,
  `update_time` datetime(6) DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of role
-- ----------------------------
BEGIN;
INSERT INTO `role` VALUES (52, '2021-05-11 15:20:05.958407', b'0', '2021-07-12 11:19:41.558512', 'ROLE_ADMIN', '管理员', '具有所有访问权限');
COMMIT;

-- ----------------------------
-- Table structure for role_menu
-- ----------------------------
DROP TABLE IF EXISTS `role_menu`;
CREATE TABLE `role_menu` (
  `role_id` int(11) NOT NULL,
  `menu_id` int(11) NOT NULL,
  PRIMARY KEY (`role_id`,`menu_id`),
  KEY `FKfg4e2mb2318tph615gh44ll3` (`menu_id`),
  CONSTRAINT `FKfg4e2mb2318tph615gh44ll3` FOREIGN KEY (`menu_id`) REFERENCES `menu` (`id`),
  CONSTRAINT `FKqyvxw2gg2qk0wld3bqfcb58vq` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of role_menu
-- ----------------------------
BEGIN;
INSERT INTO `role_menu` VALUES (52, 152);
INSERT INTO `role_menu` VALUES (52, 153);
INSERT INTO `role_menu` VALUES (52, 154);
INSERT INTO `role_menu` VALUES (52, 155);
INSERT INTO `role_menu` VALUES (52, 156);
INSERT INTO `role_menu` VALUES (52, 302);
INSERT INTO `role_menu` VALUES (52, 303);
INSERT INTO `role_menu` VALUES (52, 305);
INSERT INTO `role_menu` VALUES (52, 502);
INSERT INTO `role_menu` VALUES (52, 503);
INSERT INTO `role_menu` VALUES (52, 703);
INSERT INTO `role_menu` VALUES (52, 704);
INSERT INTO `role_menu` VALUES (52, 752);
INSERT INTO `role_menu` VALUES (52, 802);
INSERT INTO `role_menu` VALUES (52, 803);
INSERT INTO `role_menu` VALUES (52, 804);
INSERT INTO `role_menu` VALUES (52, 809);
INSERT INTO `role_menu` VALUES (52, 810);
INSERT INTO `role_menu` VALUES (52, 811);
INSERT INTO `role_menu` VALUES (52, 1502);
INSERT INTO `role_menu` VALUES (52, 1503);
INSERT INTO `role_menu` VALUES (52, 2252);
INSERT INTO `role_menu` VALUES (52, 2253);
INSERT INTO `role_menu` VALUES (52, 6102);
INSERT INTO `role_menu` VALUES (52, 6752);
INSERT INTO `role_menu` VALUES (52, 9452);
INSERT INTO `role_menu` VALUES (52, 9502);
INSERT INTO `role_menu` VALUES (52, 13352);
COMMIT;

-- ----------------------------
-- Table structure for sys_env
-- ----------------------------
DROP TABLE IF EXISTS `sys_env`;
CREATE TABLE `sys_env` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `is_delete` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `env` varchar(255) NOT NULL,
  `env_name` varchar(255) DEFAULT NULL,
  `is_default` bit(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_6vnobashedni21enf9pw1ohw` (`env`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of sys_env
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int(11) NOT NULL,
  `create_time` datetime(6) DEFAULT NULL,
  `is_delete` bit(1) DEFAULT NULL,
  `update_time` datetime(6) DEFAULT NULL,
  `avatar_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gender` int(11) NOT NULL,
  `nickname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `mobile_phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `salt` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_enabled` bit(1) DEFAULT NULL,
  `is_locked` bit(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_sb8bbouer5wak8vyiiy4pf2bx` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES (1, '2021-05-11 15:20:05.995018', b'0', '2021-07-14 11:14:19.658896', '/imgs/avatar/default.png', '', 1, '管理员', '5b9a079ebe999bf0edbe2f665e6fc9f2', '13012345678', 'AeC0rlakx6nkIs6xJYqQYQTlvNRISLbdz7K4aKa04T39wxRTL1oOZs5rlTDos9ryXoZCniedn5a4eSZJNxk2mw==', 'admin', b'1', b'0');
COMMIT;

-- ----------------------------
-- Table structure for user_role
-- ----------------------------
DROP TABLE IF EXISTS `user_role`;
CREATE TABLE `user_role` (
  `user_id` int(11) NOT NULL,
  `role` varchar(255) DEFAULT NULL,
  KEY `FK55itppkw3i07do3h7qoclqd4k` (`user_id`),
  CONSTRAINT `FK55itppkw3i07do3h7qoclqd4k` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of user_role
-- ----------------------------
BEGIN;
INSERT INTO `user_role` VALUES (1, 'ROLE_ADMIN');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
