/*
SQLyog 企业版 - MySQL GUI v8.14 
MySQL - 8.0.28 : Database - data_center_aeon_admin
*********************************************************************
*/


/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`data_center_aeon_admin` /*!40100 DEFAULT CHARACTER SET utf8 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `data_center_aeon_admin`;

/*Table structure for table `device_alert_template` */

DROP TABLE IF EXISTS `device_alert_template`;

CREATE TABLE `device_alert_template` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `tmpl_name` varchar(100) DEFAULT NULL,
  `level` varchar(20) DEFAULT NULL COMMENT '告警级别',
  `message` varchar(999) DEFAULT NULL COMMENT '告警信息',
  `flag` int DEFAULT '0' COMMENT '0 开启，1关闭',
  `template_defs` varchar(999) DEFAULT NULL COMMENT '模板定义',
  `forward_type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '转发类型api, mail, sms',
  `alert_cancel_template_defs` varchar(999) DEFAULT '' COMMENT '告警解除模板定义',
  `alert_cancel_message` varchar(999) DEFAULT '' COMMENT '告警解除模板初步填充后内容',
  `alert_title` varchar(999) DEFAULT NULL,
  `alert_cancel_title` varchar(999) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='设备告警模板信息';

/*Table structure for table `device_alert_template_bind` */

DROP TABLE IF EXISTS `device_alert_template_bind`;

CREATE TABLE `device_alert_template_bind` (
  `device_id` varchar(45) NOT NULL,
  `device_alert_template_id` bigint NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
