-- DROP DATABASE IF EXISTS `se-cloud`;

CREATE DATABASE IF NOT EXISTS  `se-cloud` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

USE `se-cloud`;

-- ----------------------------
-- 01、分系统任务控制表
-- ----------------------------
drop table if exists sys_task_ctrl;
create table sys_task_ctrl (
  task_id           bigint(20)      not null auto_increment    comment '任务ID',
  prj_id            varchar(50)                                comment '任务ID',
  prj_name          varchar(200)                               comment '任务名称',
  think_id          varchar(50)                                comment '想定ID',
  think_name        varchar(200)                               comment '想定名称',
  is_save           char(1)         default 0                  comment '是否保存（0正常 1停用）',
  node              varchar(2000)                              comment '节点',  
  status            char(1)         default 0                  comment '状态（0正常 1停用）',
  create_by         varchar(64)     default ''                 comment '创建者',
  create_time       datetime                                   comment '创建时间',
  update_by         varchar(64)     default ''                 comment '更新者',
  update_time       datetime                                   comment '更新时间',
  remark            varchar(500)    default ''                 comment '备注',
  primary key (task_id)
) engine=innodb auto_increment=1 comment = '分系统任务控制表';
select * from sys_task_ctrl order by task_id;


-- ----------------------------
-- 02、系统状态监控表
-- ----------------------------
drop table if exists sys_status_ctrl;
create table sys_status_ctrl (
  status_id         bigint(20)      not null auto_increment    comment '状态ID',
  sys_name          varchar(200)                               comment '名称',
  ip                varchar(50)                                comment 'IP',
  url               varchar(4000)                              comment 'URL',
  method            varchar(20)                                comment '请求方法',
  order_num         int             default 0                  comment '显示顺序',
  status            char(1)         default 0                  comment '状态（0正常 1停用）',
  create_by         varchar(64)     default ''                 comment '创建者',
  create_time       datetime                                   comment '创建时间',
  update_by         varchar(64)     default ''                 comment '更新者',
  update_time       datetime                                   comment '更新时间',
  remark            varchar(500)    default ''                 comment '备注',
  primary key (status_id)
) engine=innodb auto_increment=1 comment = '系统状态监控表';
select * from sys_status_ctrl order by status_id;

insert into sys_status_ctrl (sys_name, ip, url, method, order_num) values ('分系统01', '127.0.0.1', 'http://localhost:8080/system/health', 'GET', 1);


-- ----------------------------
                                                                                                                                                                               
