Skip to content

Commit

Permalink
Merge pull request #10998 from yjieliang/perf_10219
Browse files Browse the repository at this point in the history
perf:研发商店组件指标数据字段优化 #10219
  • Loading branch information
bkci-bot authored Oct 18, 2024
2 parents dee83c0 + b0513d3 commit 7696fab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 0 additions & 1 deletion support-files/sql/1001_ci_store_ddl_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,6 @@ CREATE TABLE IF NOT EXISTS `T_STORE_INDEX_ELEMENT_DETAIL` (
`CREATE_TIME` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
`ELEMENT_CODE` varchar(64) NOT NULL DEFAULT '' COMMENT '指标要素标识',
PRIMARY KEY (`ID`),
UNIQUE KEY `T_STORE_INDEX_ELEMENT_DETAIL_UN` (`STORE_TYPE`,`STORE_CODE`,`INDEX_CODE`,`ELEMENT_NAME`),
UNIQUE KEY `UNI_INX_TSIE_CODE` (`STORE_CODE`,`STORE_TYPE`,`INDEX_CODE`,`ELEMENT_CODE`),
KEY `INX_TSIR_INDEX_ID` (`INDEX_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='研发商店组件指标要素详情表';
Expand Down
18 changes: 18 additions & 0 deletions support-files/sql/2003_v2.x/2020_ci_store-update_v2.0_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,24 @@ BEGIN
ALTER TABLE T_STORE_INDEX_ELEMENT_DETAIL ADD COLUMN ELEMENT_CODE varchar(64) NOT NULL DEFAULT '';
END IF;

IF NOT EXISTS(SELECT 1
FROM information_schema.statistics
WHERE TABLE_SCHEMA = db
AND TABLE_NAME = 'T_STORE_INDEX_ELEMENT_DETAIL'
AND INDEX_NAME = 'UNI_INX_TSIE_CODE') THEN
ALTER TABLE T_STORE_INDEX_ELEMENT_DETAIL
ADD CONSTRAINT UNI_INX_TSIE_CODE
UNIQUE KEY (STORE_CODE,STORE_TYPE,INDEX_CODE,ELEMENT_CODE);
END IF;

IF EXISTS(SELECT 1
FROM information_schema.statistics
WHERE TABLE_SCHEMA = db
AND TABLE_NAME = 'T_STORE_INDEX_ELEMENT_DETAIL'
AND INDEX_NAME = 'T_STORE_INDEX_ELEMENT_DETAIL_UN') THEN
ALTER TABLE T_STORE_INDEX_ELEMENT_DETAIL DROP INDEX T_STORE_INDEX_ELEMENT_DETAIL_UN;
END IF;

COMMIT;
END <CI_UBF>
DELIMITER ;
Expand Down

0 comments on commit 7696fab

Please sign in to comment.