Phase 3 added deployment strutures migration to migrateAllStructures
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// MigrateStructure migrates all deployment-related structures to the database
|
||||
func MigrateStructure(db *gorm.DB) error {
|
||||
// Migrate deployment package structures (schema_version and migration_history tables)
|
||||
return db.AutoMigrate(
|
||||
&SchemaVersion{},
|
||||
&MigrationHistory{},
|
||||
)
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package maintenance
|
||||
import (
|
||||
"bamort/config"
|
||||
"bamort/database"
|
||||
"bamort/deployment/migrations"
|
||||
"bamort/logger"
|
||||
"bamort/models"
|
||||
"bamort/user"
|
||||
@@ -52,6 +53,12 @@ func migrateAllStructures(db *gorm.DB) error {
|
||||
return fmt.Errorf("failed to migrate gsmaster structures: %w", err)
|
||||
}
|
||||
|
||||
logger.Debug("Migriere Deployment-Strukturen...")
|
||||
if err := migrations.MigrateStructure(db); err != nil {
|
||||
logger.Error("Fehler beim Migrieren der Deployment-Strukturen: %s", err.Error())
|
||||
return fmt.Errorf("failed to migrate deployment structures: %w", err)
|
||||
}
|
||||
|
||||
/*if err := importer.MigrateStructure(db); err != nil {
|
||||
return fmt.Errorf("failed to migrate importer structures: %w", err)
|
||||
}*/
|
||||
|
||||
Reference in New Issue
Block a user