docs+feat: matches 唯一键语义明确化 + source_event_id partial unique

docs/05-data.md:业务唯一=同联赛同主客同自然天;
source_event_id 用于统计回填与血缘,新增部分唯一索引说明与 upsert 查找顺序。

新增 ix_matches_source_event_id_unique(WHERE IS NOT NULL),
兼容存量空值历史行;MatchRepository.find_by_source_event_id;
events upsert 优先按 event_id 定位,回退自然键。
迁移 0021 + 回归测试修复(find_by_source_event_id 方法调用误判)。
This commit is contained in:
shangfangjian
2026-09-22 00:41:54 +08:00
parent e15b554ba3
commit 7593b99e39
5 changed files with 82 additions and 7 deletions
+3 -1
View File
@@ -165,7 +165,9 @@ class TestBzzoiroLineage:
if re.search(r"source_event_id\s*(?:is|==|!=)", stripped):
continue
if re.search(r"source_event_id\s*\.\s*\w+\s*\(", stripped):
continue # 方法调用,不是赋值
continue # 方法调用(obj.source_event_id(...)),不是赋值
if re.search(r"\w*source_event_id\s*\(", stripped):
continue # 方法调用(如 find_by_source_event_id(eid)),不是赋值
if self._ASSIGN_DIRECT.search(stripped):
continue # 直接取配对 raw
m_var = self._ASSIGN_VIA_VAR.search(stripped)