[优化] 修复数据库迁移问题

This commit is contained in:
ryan
2026-06-01 17:15:17 +08:00
parent df63b0113a
commit 663da01bda
5 changed files with 46 additions and 8 deletions
+6
View File
@@ -184,21 +184,27 @@ func migrateObservabilityLegacyColumns(db *gorm.DB) error {
}
func applyCurrentSchema(db *gorm.DB, backend string) error {
slog.Info("applyCurrentSchema: step 1/5 - auto migrate schema metadata")
if err := autoMigrateSchemaMetadata(db); err != nil {
return err
}
slog.Info("applyCurrentSchema: step 2/5 - migrate proxy route https column")
if err := migrateProxyRouteEnableHTTPSColumn(db); err != nil {
return err
}
slog.Info("applyCurrentSchema: step 3/5 - auto migrate all models")
if err := autoMigrateAll(db); err != nil {
return err
}
slog.Info("applyCurrentSchema: step 4/5 - migrate text columns")
if err := migrateTextColumns(db, backend); err != nil {
return err
}
slog.Info("applyCurrentSchema: step 5/5 - migrate observability legacy columns")
if err := migrateObservabilityLegacyColumns(db); err != nil {
return err
}
slog.Info("applyCurrentSchema: completed")
return nil
}