• 李文光's avatar
    fix(ingest): 修复 SQLite 外键序导致采集入库与整包状态写入 500 · 3485580a
    李文光 authored
    采集 upsert_ingest_candidate 与整包 replace_state 在无 ORM relationship 时,SQLAlchemy 同一 commit 内不保证按外键依赖顺序插入,子表(ingest_items / tasks / recruitment_events)可能在父行(candidates / resume_files / offers)存在前被写入,SQLite 开启 PRAGMA foreign_keys 时报 FOREIGN KEY constraint failed。
    
    - ingest: 在添加 ingest_items 前显式 flush 父行。
    - state: 在候选人/Offer/任务各循环后显式 flush,强制 岗位→候选人→Offer→任务→事件 顺序;并对任务/事件的外键做兜底:目标行不存在时置空,避免孤儿引用(如迁入 _pool 又被清空的候选人)导致 500。
    - 新增开启外键约束的回归测试(测试夹具引擎未开 PRAGMA,此前掩蔽此类问题)。
    3485580a
Name
Last commit
Last update
..
conftest.py Loading commit data...
test_ai.py Loading commit data...
test_auth.py Loading commit data...
test_external_claims.py Loading commit data...
test_ingest.py Loading commit data...
test_jd_import.py Loading commit data...
test_job_types.py Loading commit data...
test_pool.py Loading commit data...
test_recruiting_rules_agent.py Loading commit data...
test_reports.py Loading commit data...
test_resume_parser.py Loading commit data...
test_resume_parser_llm.py Loading commit data...
test_risk_profile.py Loading commit data...
test_state.py Loading commit data...
test_static_security.py Loading commit data...