From e3db157ba8d78f6046114055a24f7812e224e576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=AB=A0=E6=B5=A9?= Date: Wed, 28 Oct 2026 14:33:55 +0800 Subject: [PATCH] =?UTF-8?q?test(postgres):=20=E8=BF=81=E7=A7=BB=E6=B8=85?= =?UTF-8?q?=E5=8D=95=E8=B7=9F=E9=9A=8F=20000066=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为什么:新增 000066 整库作业迁移后,清单测试仍写死 65 条,CI tests-go 因此红。 不只改计数,同时断言 66 建出 library_versions 与 library_jobs_active 互斥索引。 --- internal/platform/postgres/migrations_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/platform/postgres/migrations_test.go b/internal/platform/postgres/migrations_test.go index 5a2586c..01b0534 100644 --- a/internal/platform/postgres/migrations_test.go +++ b/internal/platform/postgres/migrations_test.go @@ -11,8 +11,13 @@ func TestEmbeddedMigrationsAreVersionSorted(t *testing.T) { if err != nil { t.Fatalf("loadMigrations() error = %v", err) } - if len(migrations) != 65 { - t.Fatalf("migration count = %d, want 65", len(migrations)) + if len(migrations) != 66 { + t.Fatalf("migration count = %d, want 66", len(migrations)) + } + if last := migrations[len(migrations)-1]; last.Version != 66 || + !strings.Contains(last.UpSQL, "CREATE TABLE library_versions") || + !strings.Contains(last.UpSQL, "library_jobs_active") { + t.Fatalf("migration 66 = %#v", last) } if migrations[0].Version != 1 || !strings.Contains(migrations[0].UpSQL, "CREATE TABLE IF NOT EXISTS jobs") { t.Fatalf("migration 1 = %#v", migrations[0])