feat(deploy): 在线更新验收 - 新增 schema v2 迁移与备份提示

This commit is contained in:
ddCat
2026-08-30 23:21:37 +08:00
parent 3aefefc1aa
commit 3f16cf19aa
6 changed files with 19 additions and 3 deletions

View File

@@ -23,6 +23,9 @@ func TestMigrateSchemaRecordsAndValidatesVersion(t *testing.T) {
if !status.Ready || status.Current != CurrentSchemaVersion {
t.Fatalf("unexpected schema status: %#v", status)
}
if !db.Migrator().HasIndex(&schemaMigration{}, "idx_schema_migrations_applied_at") {
t.Fatal("schema migration v2 did not create the applied_at index")
}
if err := MigrateSchema(db); err != nil {
t.Fatalf("migration should be idempotent: %v", err)
}