fix(#88): SQL Server work_no 过滤唯一索引,修复新增用户失败 #89

Merged
Lijianping merged 1 commit from fix/88-sys-user-work-no-unique into main 2026-11-05 16:03:44 +08:00
Collaborator

变更摘要

  • 新增 db/txys-patch/sys_user_work_no_unique_sqlserver.sql:将 uniq_sys_user_work_no 改为 WHERE work_no IS NOT NULL 的过滤唯一索引,对齐 MySQL 多 NULL 语义
  • 修复 PC 新增用户未填工号时撞到已有 NULL 工号行导致 500「操作失败」

Closes #88

自测步骤

  1. 在 SQL Server txys_boot 执行该补丁(sqlcmd -I)
  2. 确认已有用户 work_no 为 NULL 时,再 POST /sys/user/add(不传 workNo)返回成功
  3. 填相同非空工号应仍被唯一约束拒绝

文档影响

无(库补丁,接口契约未变)

## 变更摘要 - 新增 `db/txys-patch/sys_user_work_no_unique_sqlserver.sql`:将 `uniq_sys_user_work_no` 改为 `WHERE work_no IS NOT NULL` 的过滤唯一索引,对齐 MySQL 多 NULL 语义 - 修复 PC 新增用户未填工号时撞到已有 NULL 工号行导致 500「操作失败」 Closes #88 ## 自测步骤 1. 在 SQL Server `txys_boot` 执行该补丁(`sqlcmd -I`) 2. 确认已有用户 `work_no` 为 NULL 时,再 `POST /sys/user/add`(不传 workNo)返回成功 3. 填相同非空工号应仍被唯一约束拒绝 ## 文档影响 无(库补丁,接口契约未变)
fix(#88): SQL Server work_no 过滤唯一索引,修复新增用户失败
All checks were successful
CI / backend-compile (pull_request) Successful in 10m9s
dbb0d7c8e2
Co-authored-by: Cursor <cursoragent@cursor.com>
Lijianping deleted branch fix/88-sys-user-work-no-unique 2026-11-05 16:03:44 +08:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jiaoce/xm_txys2_back!89
No description provided.