fix: validate explicit migrations and preserve large business ids

This commit is contained in:
Yvan
2026-11-06 07:00:05 +08:00
parent f6f2a4745e
commit 0f0ec2e6d7
53 changed files with 2653 additions and 1445 deletions
+2 -2
View File
@@ -180,7 +180,7 @@ func TestChannelPortraitHTTPTotalTiersAndScope(t *testing.T) {
}
data = call(7, "sourceDb=lx&promoteId=101&period=last7", 0)
basic = data["basic"].(map[string]any)
if basic["parentPromoteId"] != float64(100) || basic["parentPromoteName"] != "root-account" || basic["lastLoginTime"] != nil {
if basic["parentPromoteId"] != "100" || basic["parentPromoteName"] != "root-account" || basic["lastLoginTime"] != nil {
t.Fatal("上级应读同平台当前账号,不能沿用旧快照名")
}
call(99, "sourceDb=lx&promoteId=100", 7)
@@ -189,7 +189,7 @@ func TestChannelPortraitHTTPTotalTiersAndScope(t *testing.T) {
t.Fatal(err)
}
data = call(7, "sourceDb=lx&promoteId=100", 0)
if data["available"] != false || data["metrics"] != nil || data["basic"].(map[string]any)["promoteId"] != float64(100) {
if data["available"] != false || data["metrics"] != nil || data["basic"].(map[string]any)["promoteId"] != "100" {
t.Fatal("缺数据时应保留已授权基本资料并标明未知")
}
}