feat: automate business upgrades and sync reviewed frontend

This commit is contained in:
Yvan
2026-11-06 15:48:35 +08:00
parent 7df74bc8e8
commit 9fccd804a3
58 changed files with 5689 additions and 259 deletions
+4 -8
View File
@@ -168,14 +168,10 @@ func (d *Data) reloadConfig(ctx context.Context) error {
return fmt.Errorf("reload database: %w", err)
}
}
if databaseReady && (next.Admin.System == nil || !next.Admin.System.DisableAutoMigrate) {
if err = migrateAll(candidateDB.WithContext(ctx), d.catalog); err != nil {
return fmt.Errorf("reload database migrations: %w", err)
}
}
if databaseReady && next.Admin.System != nil && next.Admin.System.DisableAutoMigrate {
if err = checkMigratedSchema(candidateDB.WithContext(ctx), d.catalog); err != nil {
return fmt.Errorf("reload database schema: %w", err)
if databaseReady {
disable := next.Admin.System != nil && next.Admin.System.DisableAutoMigrate
if err = prepareConfiguredDatabase(ctx, candidateDB, next.Data.Database, d.catalog, d.logger(), configPath, disable); err != nil {
return fmt.Errorf("reload database upgrade: %w", err)
}
}
storageConfig, err := dataintegration.ResolveStorageConfig(candidateDB.WithContext(ctx), next.Admin.Storage)