REM:
1. 增加数据库表创建SQL脚本
2. 增加数据库记录初始化添加脚本
This commit is contained in:
HuangXin 2020-05-06 17:13:36 +08:00
parent 00c1c8d09e
commit 5b1daf3aeb
3 changed files with 58 additions and 37 deletions

View File

@ -23,8 +23,7 @@ spring.datasource.dbcp2.connection-properties=characterEncoding=utf8
# 下划线转驼峰 将带有下划线的表字段映射为驼峰格式的实体类属性 # 下划线转驼峰 将带有下划线的表字段映射为驼峰格式的实体类属性
#mybatis.configuration.map-underscore-to-camel-case: true #mybatis.configuration.map-underscore-to-camel-case: true
mybatis.mapper-locations=classpath*:mappers/*.xml mybatis.mapper-locations=classpath*:mappers/*.xml
mybatis.type-aliases-package=com.cmcc.hy.phoenix.entity mybatis.type-aliases-package=com.dispose.pojo.entity
#config log
logging.config=file:config/logback.xml logging.config=file:config/logback.xml
#config tomcat #config tomcat
server.tomcat.max-threads=128 server.tomcat.max-threads=128

View File

@ -1,2 +1,2 @@
-- INSERT INTO `phoenix_user`(`id`,`name`,`password`,`salt`,`email`,`phone_number`) VALUES (1, 'user_1', 'ff342e862e7c3285cdc07e56d6b8973b', '412365a109674b2dbb1981ed561a4c70', 'user1@cmhi.chinamobile.com', '17300000001'); insert into `dispose_device`(`id`,`ipAddr`,`type`,`areaCode`,`name`,`manufacturer`,`model`,`version`,`readme`,`status`) values (1,'10.88.77.15',0,0,'中移杭研实验室清洗设备','DPTech','UMC','5.7.13','实验室测试设备',0);
-- INSERT INTO `phoenix_user`(`id`,`name`,`password`,`salt`,`email`,`phone_number`) VALUES (2, 'user_2', '6c6bf02c8d5d3d128f34b1700cb1e32c', 'fcbdd0e8a9404a5585ea4e01d0e4d7a0', 'user2@cmhi.chinamobile.com', '17300000002'); insert into `user_account`(`id`,`username`,`password`,`lastLoginTime`,`lockTime`,`status`) values (1,'admin','c3855e6b6bb120450f160ba91134522868f89d36062f2061ebeefd80817e1d58','2020-05-06 11:31:58','0000-00-00 00:00:00',0);

View File

@ -1,41 +1,63 @@
DROP TABLE IF EXISTS `phoenix_user`; /*Table structure for table `dispose_device` */
CREATE TABLE `phoenix_user`
DROP TABLE IF EXISTS `dispose_device`;
CREATE TABLE IF NOT EXISTS `dispose_device`
( (
`id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT '主键', `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '设备唯一标识符',
`name` VARCHAR(32) NOT NULL UNIQUE COMMENT '用户名', `ipAddr` varchar(64) DEFAULT NULL COMMENT '设备IP地址, IPv4/IPv6',
`password` VARCHAR(32) NOT NULL COMMENT '加密后的密码', `type` int(11) NOT NULL DEFAULT '0' COMMENT '能力节点类型0迪普UMC平台1浩瀚设备',
`salt` VARCHAR(32) NOT NULL COMMENT '加密使用的盐', `areaCode` int(11) DEFAULT NULL COMMENT '设备物理位置区域码',
`email` VARCHAR(32) NOT NULL UNIQUE COMMENT '邮箱', `name` varchar(256) DEFAULT NULL COMMENT '设备名称',
`phone_number` VARCHAR(15) NOT NULL UNIQUE COMMENT '手机号码', `manufacturer` varchar(128) DEFAULT NULL COMMENT '生产厂商',
`status` INT(2) NOT NULL DEFAULT 1 COMMENT '状态,-1逻辑删除0禁用1启用', `model` varchar(128) DEFAULT NULL COMMENT '型号',
`create_time` DATETIME DEFAULT NOW() COMMENT '创建时间', `version` varchar(128) DEFAULT NULL COMMENT '软件版本',
`last_login_time` DATETIME DEFAULT NULL COMMENT '上次登录时间', `readme` varchar(1024) DEFAULT NULL COMMENT '备注',
`last_update_time` DATETIME DEFAULT NOW() COMMENT '上次更新时间' `status` int(11) NOT NULL DEFAULT '0' COMMENT '状态0正常 1删除',
PRIMARY KEY (`id`),
UNIQUE KEY `ipAddr` (`ipAddr`)
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8 COMMENT ='phoenix用户示例表'; AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8;
/*Table structure for table `user_account` */
DROP TABLE IF EXISTS `user_account`;
DROP TABLE IF EXISTS `info_collection`; CREATE TABLE IF NOT EXISTS `user_account`
CREATE TABLE `info_collection`
( (
`id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT '主键', `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '账户唯一编号',
`username` VARCHAR(32) NOT NULL COMMENT '联系人', `username` varchar(128) NOT NULL COMMENT '用户名',
`organization` VARCHAR(128) NOT NULL COMMENT '单位名称', `password` varchar(512) NOT NULL COMMENT '密码',
`province_code` VARCHAR(32) NOT NULL COMMENT '省编码', `lastLoginTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后一次成功登录时间',
`province` VARCHAR(128) NOT NULL COMMENT '', `lockTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '账户锁定时间',
`city` VARCHAR(128) NOT NULL COMMENT '', `status` int(11) DEFAULT NULL COMMENT '账户状态',
`district` VARCHAR(128) NOT NULL COMMENT '', PRIMARY KEY (`id`),
`address` VARCHAR(128) NOT NULL COMMENT '单位地址', UNIQUE KEY `USERNAME` (`username`)
`email` VARCHAR(32) NOT NULL COMMENT '邮箱',
`phone_number` VARCHAR(32) NOT NULL COMMENT '手机号码',
`comment` VARCHAR(128) NOT NULL COMMENT '备注',
`product_type` VARCHAR(32) NOT NULL COMMENT '产品类型waf,ddos',
`sync_status` tinyint NOT NULL DEFAULT -1 COMMENT '是否同步过1同步过0未同步',
`create_time` DATETIME DEFAULT NOW() COMMENT '创建时间',
`update_time` DATETIME DEFAULT NOW() COMMENT '上次更新时间'
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8 COMMENT ='信息收集表'; AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8;
CREATE UNIQUE INDEX ic_phone_pt_index ON info_collection (phone_number, product_type); /*Table structure for table `dispose_task` */
DROP TABLE IF EXISTS `dispose_task`;
CREATE TABLE IF NOT EXISTS `dispose_task`
(
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '处置任务唯一标识符',
`deviceId` int(10) unsigned NOT NULL COMMENT '处置设备唯一标识符',
`accountId` int(10) unsigned NOT NULL COMMENT '用户唯一标识符',
`type` int(11) unsigned NOT NULL COMMENT '处置能力类型0清洗 1高防 2黑洞 3检测',
`disposeIp` varchar(128) NOT NULL COMMENT '处置IP',
`beginTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '开始时间',
`planEndTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '计划结束时间',
`endTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '实际结束时间',
`flowDirection` int(11) DEFAULT '2' COMMENT '流量方向, 0流入1流出2双向',
`attackType` varchar(1024) DEFAULT '0' COMMENT '攻击类型默认0 全部攻击',
`flowBandWidth` int(10) unsigned DEFAULT '1024' COMMENT '攻击流量占用带宽',
`currentStatus` int(11) NOT NULL DEFAULT '0' COMMENT '状态0停止。1启动',
PRIMARY KEY (`id`),
KEY `dispose_task_device_capacity_id_fk` (`type`),
KEY `dispose_task_user_account_id_fk` (`accountId`),
CONSTRAINT `dispose_task_user_account_id_fk` FOREIGN KEY (`accountId`) REFERENCES `user_account` (`id`) ON DELETE NO ACTION
) ENGINE = InnoDB
AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8;