DROP TABLE IF EXISTS `bug_management`;
CREATE TABLE `bug_management` (
	`bug_id` VARCHAR(32) NOT NULL COMMENT '缺陷id' ,
	`bug_title` VARCHAR(255) NULL DEFAULT NULL COMMENT '缺陷标题' ,
	`bug_grade` CHAR(1) NULL DEFAULT NULL COMMENT '严重程度:   建议性错误-E类、警告性错误-D类、一般性错误-C类、严重性错误-B类、致命性错误-A类\r\n' ,
	`bug_type` VARCHAR(50) NULL DEFAULT NULL COMMENT '缺陷分类:  1.需求缺陷、2.设计缺陷、3.编码缺陷、4.UI缺陷、5.兼容性缺陷、6.环境缺陷、7.用户体验、8移植缺陷' ,
	`bug_order` VARCHAR(50) NULL DEFAULT NULL COMMENT '缺陷编码' ,
	`bug_from` VARCHAR(2) NULL DEFAULT NULL COMMENT '缺陷来源：1.手动提交,2.自动化提交,3.测试执行提交' ,
	`emergency` VARCHAR(1) NULL DEFAULT NULL COMMENT '紧急程度：1.高、2.中、3.低' ,
	`is_reappear` CHAR(1) NULL DEFAULT NULL COMMENT '可重现：Y是、N否' ,
	`bug_status` VARCHAR(50) NULL DEFAULT NULL COMMENT '缺陷状态：1.新建、2.打开、3.已分配、4.拒绝、5.待验证、6.处理中、7.延迟、8.已修复、9.关闭、10.无效、11.重新打开、12.挂起、13.待裁决、14.待完善、15.待分配、16.待修复、17.待审核' ,
	`receiver` VARCHAR(32) NULL DEFAULT NULL COMMENT '分配给，缺陷接收人' ,
	`repair_time` DATETIME NULL DEFAULT NULL COMMENT '修复时间',
	`repair_user` VARCHAR(32) NULL DEFAULT NULL COMMENT '修复人' ,
	`close_time` DATETIME NULL DEFAULT NULL COMMENT '关闭日期',
	`error_message` TEXT(65535) NULL DEFAULT NULL COMMENT '错误信息描述' ,
	`expands` TEXT(65535) NULL DEFAULT NULL COMMENT '自定义字段' ,
	`message` TEXT(65535) NULL DEFAULT NULL COMMENT '注释' ,
	`system_id` VARCHAR(50) NULL DEFAULT NULL COMMENT '系统id' ,
	`round_id` VARCHAR(50) NULL DEFAULT NULL COMMENT '轮次id' ,
	`module_id` VARCHAR(50) NULL DEFAULT NULL COMMENT '模块id' ,
	`case_num` INT(11) NULL DEFAULT '0' COMMENT '关联用例数',
	`pro_id` VARCHAR(32) NULL DEFAULT NULL COMMENT '项目id' ,
	`created_by` VARCHAR(32) NULL DEFAULT NULL COMMENT '创建发现人' ,
	`created_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
	`updated_by` VARCHAR(50) NULL DEFAULT NULL COMMENT '更新人' ,
	`updated_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
	`tenant_id` VARCHAR(50) NULL DEFAULT NULL COMMENT '租户id' ,
	`order_seq` INT(6) NULL DEFAULT NULL COMMENT '顺序号',
	`USER_DEFINED_IDX1` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX1'))) virtual ,
	`USER_DEFINED_IDX2` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX2'))) virtual ,
	`USER_DEFINED_IDX3` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX3'))) virtual ,
	`USER_DEFINED_IDX4` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX4'))) virtual ,
	`USER_DEFINED_IDX5` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX5'))) virtual ,
	`USER_DEFINED_IDX6` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX6'))) virtual ,
	`USER_DEFINED_IDX7` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX7'))) virtual ,
	`USER_DEFINED_IDX8` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX8'))) virtual ,
	`USER_DEFINED_IDX9` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX9'))) virtual ,
	`USER_DEFINED_IDX10` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX10'))) virtual ,
	`USER_DEFINED_IDX11` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX11'))) virtual ,
	`USER_DEFINED_IDX12` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX12'))) virtual ,
	`USER_DEFINED_IDX13` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX13'))) virtual ,
	`USER_DEFINED_IDX14` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX14'))) virtual ,
	`USER_DEFINED_IDX15` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX15'))) virtual ,
	`USER_DEFINED_IDX16` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX16'))) virtual ,
	`USER_DEFINED_IDX17` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX17'))) virtual ,
	`USER_DEFINED_IDX18` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX18'))) virtual ,
	`USER_DEFINED_IDX19` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX19'))) virtual ,
	`USER_DEFINED_IDX20` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX20'))) virtual ,
	PRIMARY KEY (`bug_id`) USING BTREE,
	INDEX `tenant_id` (`tenant_id`) USING BTREE,
	INDEX `pro_id` (`pro_id`) USING BTREE,
	INDEX `created_time_tenant_id` (`tenant_id`, `created_time`) USING BTREE,
	INDEX `bug_id_pro_id_created_time_tenant_id` (`tenant_id`, `pro_id`, `bug_id`, `created_time`) USING BTREE
)
COMMENT='缺陷管理'
ENGINE=InnoDB
COLLATE='utf8mb4_bin'
;

--CREATE TABLE `bug_management` (
--	`bug_id` VARCHAR(32) NOT NULL COMMENT '缺陷id' COLLATE 'utf8_general_ci',
--	`bug_title` VARCHAR(255) NULL DEFAULT NULL COMMENT '缺陷标题' COLLATE 'utf8_general_ci',
--	`bug_grade` CHAR(1) NULL DEFAULT NULL COMMENT '严重程度:   建议性错误-E类、警告性错误-D类、一般性错误-C类、严重性错误-B类、致命性错误-A类\r\n' COLLATE 'utf8_general_ci',
--	`bug_type` VARCHAR(50) NULL DEFAULT NULL COMMENT '缺陷分类:  1.需求缺陷、2.设计缺陷、3.编码缺陷、4.UI缺陷、5.兼容性缺陷、6.环境缺陷、7.用户体验、8移植缺陷' COLLATE 'utf8_general_ci',
--	`bug_order` VARCHAR(50) NULL DEFAULT NULL COMMENT '缺陷编码' COLLATE 'utf8_general_ci',
--	`bug_from` VARCHAR(2) NULL DEFAULT NULL COMMENT '缺陷来源：1.手动提交,2.自动化提交,3.测试执行提交' COLLATE 'utf8_general_ci',
--	`emergency` VARCHAR(1) NULL DEFAULT NULL COMMENT '紧急程度：1.高、2.中、3.低' COLLATE 'utf8_general_ci',
--	`is_reappear` CHAR(1) NULL DEFAULT NULL COMMENT '可重现：Y是、N否' COLLATE 'utf8_general_ci',
--	`bug_status` VARCHAR(50) NULL DEFAULT NULL COMMENT '缺陷状态：1.新建、2.打开、3.已分配、4.拒绝、5.待验证、6.处理中、7.延迟、8.已修复、9.关闭、10.无效、11.重新打开、12.挂起、13.待裁决、14.待完善、15.待分配、16.待修复、17.待审核' COLLATE 'utf8_general_ci',
--	`receiver` VARCHAR(32) NULL DEFAULT NULL COMMENT '分配给，缺陷接收人' COLLATE 'utf8_general_ci',
--	`repair_time` DATETIME NULL DEFAULT NULL COMMENT '修复时间',
--	`repair_user` VARCHAR(32) NULL DEFAULT NULL COMMENT '修复人' COLLATE 'utf8_general_ci',
--	`close_time` DATETIME NULL DEFAULT NULL COMMENT '关闭日期',
--	`error_message` TEXT(65535) NULL DEFAULT NULL COMMENT '错误信息描述' COLLATE 'utf8_general_ci',
--	`expands` TEXT(65535) NULL DEFAULT NULL COMMENT '自定义字段' COLLATE 'utf8_general_ci',
--	`message` TEXT(65535) NULL DEFAULT NULL COMMENT '注释' COLLATE 'utf8_general_ci',
--	`system_id` VARCHAR(50) NULL DEFAULT NULL COMMENT '系统id' COLLATE 'utf8_general_ci',
--	`round_id` VARCHAR(50) NULL DEFAULT NULL COMMENT '轮次id' COLLATE 'utf8_general_ci',
--	`module_id` VARCHAR(50) NULL DEFAULT NULL COMMENT '模块id' COLLATE 'utf8_general_ci',
--	`case_num` INT(11) NULL DEFAULT '0' COMMENT '关联用例数',
--	`pro_id` VARCHAR(32) NULL DEFAULT NULL COMMENT '项目id' COLLATE 'utf8_general_ci',
--	`created_by` VARCHAR(32) NULL DEFAULT NULL COMMENT '创建发现人' COLLATE 'utf8_general_ci',
--	`created_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
--	`updated_by` VARCHAR(50) NULL DEFAULT NULL COMMENT '更新人' COLLATE 'utf8_general_ci',
--	`updated_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
--	`tenant_id` VARCHAR(50) NULL DEFAULT NULL COMMENT '租户id' COLLATE 'utf8_general_ci',
--	`order_seq` INT(6) NULL DEFAULT NULL COMMENT '顺序号',
--	`USER_DEFINED_IDX1` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX1'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX2` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX2'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX3` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX3'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX4` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX4'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX5` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX5'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX6` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX6'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX7` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX7'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX8` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX8'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX9` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX9'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX10` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX10'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX11` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX11'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX12` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX12'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX13` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX13'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX14` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX14'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX15` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX15'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX16` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX16'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX17` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX17'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX18` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX18'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX19` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX19'))) virtual COLLATE 'utf8_general_ci',
--	`USER_DEFINED_IDX20` VARCHAR(1000) DEFAULT NULL AS (json_unquote(json_extract(`expands`,'$.USER_DEFINED_IDX20'))) virtual COLLATE 'utf8_general_ci',
--	PRIMARY KEY (`bug_id`) USING BTREE,
--	INDEX `tenant_id` (`tenant_id`) USING BTREE,
--	INDEX `pro_id` (`pro_id`) USING BTREE,
--	INDEX `created_time_tenant_id` (`tenant_id`, `created_time`) USING BTREE,
--	INDEX `bug_id_pro_id_created_time_tenant_id` (`tenant_id`, `pro_id`, `bug_id`, `created_time`) USING BTREE
--)
--COMMENT='缺陷管理'
--COLLATE='utf8_bin'
--ENGINE=InnoDB
--;
