use kgraph;

DROP TABLE
IF
	EXISTS t_breakdown;
CREATE TABLE t_breakdown (
	id BIGINT ( 20 ) NOT NULL auto_increment COMMENT '序号',
	war_zone VARCHAR ( 64 ) COMMENT '战区',
	base VARCHAR ( 64 ) COMMENT '基地',
	division VARCHAR ( 64 ) COMMENT '师',
	brigade VARCHAR ( 64 ) COMMENT '旅团',
	airplane_model VARCHAR ( 64 ) COMMENT '机型',
	air_number VARCHAR ( 64 ) COMMENT '机号',
	discovery_timing VARCHAR ( 64 ) COMMENT '发现时机',
	discovery_date datetime COMMENT '发现日期',
	major VARCHAR ( 64 ) COMMENT '专业',
	`describe` VARCHAR ( 255 ) COMMENT '故障描述',
	reason VARCHAR ( 255 ) COMMENT '故障原因',
	breakdown_unit_name VARCHAR ( 64 ) COMMENT '故障件名称',
	breakdown_unit_type VARCHAR ( 64 ) COMMENT '故障件型号',
	breakdown_unit_number VARCHAR ( 64 ) COMMENT '故障件号码',
	unit_system VARCHAR ( 64 ) COMMENT '故障件所属系统',
	consequence VARCHAR ( 255 ) COMMENT '故障后果',
	duty VARCHAR ( 255 ) COMMENT '故障责任',
	replace_unit_name VARCHAR ( 64 ) COMMENT '故换件名称',
	replace_unit_type VARCHAR ( 64 ) COMMENT '故换件型别',
	replace_unit_number VARCHAR ( 64 ) COMMENT '故换件号码',
	method VARCHAR ( 64 ) COMMENT '排除方法',
	repaired_date datetime COMMENT '修复日期',
	create_by VARCHAR ( 64 ) DEFAULT '' COMMENT '创建者',
	create_time datetime COMMENT '创建时间',
	update_by VARCHAR ( 64 ) DEFAULT '' COMMENT '更新者',
	update_time datetime COMMENT '更新时间',
PRIMARY KEY ( id )
) ENGINE = INNODB COMMENT = '故障信息表';

DROP TABLE
IF
	EXISTS t_encyclopedia;
CREATE TABLE t_encyclopedia (
	id BIGINT ( 20 ) NOT NULL auto_increment COMMENT '序号',
	title VARCHAR ( 64 ) COMMENT '标题',
	`desc` VARCHAR ( 255 ) COMMENT '描述',
	`text` text  COMMENT '文本内容',
	create_by VARCHAR ( 64 ) DEFAULT '' COMMENT '创建者',
	create_time datetime COMMENT '创建时间',
	update_by VARCHAR ( 64 ) DEFAULT '' COMMENT '更新者',
	update_time datetime COMMENT '更新时间',
PRIMARY KEY ( id )
) ENGINE = INNODB COMMENT = '维修百科表';

-- 抽取结果信息
DROP TABLE
IF
	EXISTS t_extract_result;
CREATE TABLE t_extract_result (
	id BIGINT ( 20 ) NOT NULL auto_increment COMMENT '编号',
	sub_task_id BIGINT ( 20 ) NOT NULL COMMENT '子任务id',
	result TEXT COMMENT '抽取结果集',
	create_by VARCHAR ( 64 ) DEFAULT '' COMMENT '创建者',
	create_time datetime COMMENT '创建时间',
	update_by VARCHAR ( 64 ) DEFAULT '' COMMENT '更新者',
	update_time datetime COMMENT '更新时间',
PRIMARY KEY ( id )
) ENGINE = INNODB auto_increment = 1 COMMENT = '抽取结果信息';