fix: 迁移顺序修复

This commit is contained in:
tbphp
2025-07-12 22:53:33 +08:00
parent 37b3bf715b
commit 95b52464a6

View File

@@ -103,11 +103,11 @@ func (a *App) Start() error {
// 数据库迁移 // 数据库迁移
if err := a.db.AutoMigrate( if err := a.db.AutoMigrate(
&models.RequestLog{},
&models.GroupHourlyStat{},
&models.APIKey{},
&models.SystemSetting{}, &models.SystemSetting{},
&models.Group{}, &models.Group{},
&models.APIKey{},
&models.RequestLog{},
&models.GroupHourlyStat{},
); err != nil { ); err != nil {
return fmt.Errorf("database auto-migration failed: %w", err) return fmt.Errorf("database auto-migration failed: %w", err)
} }