优化结构
This commit is contained in:
@@ -11,21 +11,13 @@ import (
|
||||
// migrateAll is the single data-layer migration entry point. Module-specific
|
||||
// schema work stays with the module that owns its persistent objects.
|
||||
func migrateAll(db *gorm.DB) error {
|
||||
return migration.Run(db, []migration.Step{
|
||||
{ID: "202608200001_baseline", Migrate: func(db *gorm.DB) error {
|
||||
if err := datasystem.LegacySchemaMigration(db); err != nil {
|
||||
return err
|
||||
}
|
||||
return datapayment.Migrate(db)
|
||||
}},
|
||||
{ID: "202608200002_data_reconcile", Migrate: func(db *gorm.DB) error {
|
||||
if err := datapayment.Reconcile(db); err != nil {
|
||||
return err
|
||||
}
|
||||
return datasystem.CurrentDataMigration(db)
|
||||
}},
|
||||
{ID: "202608200003_payment_admin_surface", Migrate: func(db *gorm.DB) error {
|
||||
return datasystem.EnsureAdminSurface(db, datapayment.AdminSurface())
|
||||
}},
|
||||
})
|
||||
steps := []migration.Step{{
|
||||
ID: "202608200001_data_infrastructure",
|
||||
Migrate: func(db *gorm.DB) error {
|
||||
return db.AutoMigrate(&integrationConfigPO{})
|
||||
},
|
||||
}}
|
||||
steps = append(steps, datasystem.Migrations()...)
|
||||
steps = append(steps, datapayment.Migrations()...)
|
||||
return migration.Run(db, steps)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user