Skip to content

Commit

Permalink
bug: 用户组织架构新增线一级别组织层级,用户信息获取逻辑未更新导致部分组织架构校验逻辑校验失败 TencentBlueKing#9967
Browse files Browse the repository at this point in the history
  • Loading branch information
yjieliang committed Jan 25, 2024
1 parent d6ae12e commit b948754
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions support-files/sql/1001_ci_project_ddl_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ CREATE TABLE IF NOT EXISTS `T_USER` (
`CREATE_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
`USER_TYPE` bit(1) NOT NULL DEFAULT b'0' COMMENT '用户类型0普通用户 1公共账号',
`BUSINESS_LINE_ID` bigint(20) DEFAULT NULL COMMENT '业务线ID',
`BUSINESS_LINE_NAME` varchar(255) DEFAULT NULL COMMENT '业务线名称',
PRIMARY KEY (`USER_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户表';

Expand Down
18 changes: 18 additions & 0 deletions support-files/sql/2002_v1.x/2007_ci_project-update_v1.8_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ BEGIN
ADD COLUMN `other_router_tags` VARCHAR(128) COMMENT '其他系统网关路由tags';
END IF;

IF NOT EXISTS(SELECT 1
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = db
AND TABLE_NAME = 'T_USER'
AND COLUMN_NAME = 'BUSINESS_LINE_ID') THEN
ALTER TABLE T_USER
ADD COLUMN `BUSINESS_LINE_ID` bigint(20) NULL COMMENT '业务线ID';
END IF;

IF NOT EXISTS(SELECT 1
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = db
AND TABLE_NAME = 'T_USER'
AND COLUMN_NAME = 'BUSINESS_LINE_ID') THEN
ALTER TABLE T_USER
ADD COLUMN `BUSINESS_LINE_NAME` varchar(255) NULL COMMENT '业务线名称';
END IF;

COMMIT;
END <CI_UBF>
DELIMITER ;
Expand Down

0 comments on commit b948754

Please sign in to comment.