fix(ssf): 修复 Verification 状态迁移
为已执行旧版 0062 的环境补充不可变修复迁移,恢复 Stream 状态字段和 Verification challenge 表;同时为 timestamptz 参数增加显式类型,避免 pgx 在真实 PostgreSQL 中推断冲突。\n\n验证:pnpm test;pnpm lint;pnpm build;真实 PostgreSQL 集成测试通过。
This commit is contained in:
@@ -21,3 +21,21 @@ func TestSecurityEventIdempotencyRepairMigrationExists(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSecurityEventVerificationStateRepairMigrationExists(t *testing.T) {
|
||||
payload, err := os.ReadFile("../../migrations/0065_security_event_verification_state_repair.sql")
|
||||
if err != nil {
|
||||
t.Fatalf("read verification state repair migration: %v", err)
|
||||
}
|
||||
sql := string(payload)
|
||||
for _, statement := range []string{
|
||||
"ADD COLUMN IF NOT EXISTS stream_status",
|
||||
"ADD COLUMN IF NOT EXISTS created_at",
|
||||
"CREATE TABLE IF NOT EXISTS gateway_security_event_verification_challenges",
|
||||
"CREATE INDEX IF NOT EXISTS idx_gateway_security_event_challenges_expiry",
|
||||
} {
|
||||
if !strings.Contains(sql, statement) {
|
||||
t.Fatalf("verification state repair migration is missing %q", statement)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user