feat(deploy): 在线更新验收 - 新增 schema v2 迁移与备份提示
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user