Repository navigation
[upstream #79] 审计日志排序索引及测试修正 (058c8231b+f9a0634f8) - #84
Merged
Merged
Conversation
This was referenced Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 关联任务 / Related Issue
🚀 变更类型 / Type of change
📝 变更描述 / Description
按序 cherry-pick
058c8231b68c51ee02abee15befcd720fee9f4a2、f9a0634f843a5367ade7ec4078ade8627dd0098e,基线c54430de6a0d8fe271f5e0e38a2cc2677d0f9f17。model/audit_log.go:新增idx_audit_time_event (created_at, event_id),保留 user/time、token/time 及其余索引。model/audit_log_test.go:三库 fresh/upgrade 矩阵;PostgreSQL 通过indkey WITH ORDINALITY按真实索引键序读列。本 PR 由 Codex AI 辅助移植和验证;不宣称已获人工审阅。
📸 运行证明 / Proof of Work
复用 box 现有数据库容器,为本任务创建独立库
newapi_ci_r0198w79。实际运行:SQLite 3.50.4、MySQL 8.0.46、PostgreSQL 15.19 的全部 6 个 fresh/upgrade 子例 PASS,无 SKIP。每例重复迁移两次;验证索引列序、既有索引及唯一属性保留、数据保留、分页排序和重复 event_id 拒绝。错误日志中的重复键为预期负例。
升级用例按上游方案删除新索引模拟旧 schema,并非运行历史发布二进制。未覆盖最低版本 MySQL/PostgreSQL 或 ClickHouse;本次未改 ClickHouse 分支。
git diff --check与两文件 gofmt 检查通过。✅ 提交前检查项 / Checklist
idx_audit_time_event列序为created_at, event_id