fix: 修复默认分组初始化导致启动失败的问题
- 标准版不再创建默认分组,简易模式保持创建 - 简易模式下删除默认分组后重启自动恢复(而非报唯一键冲突) - AutoMigrate 函数增加 runMode 参数以区分运行模式
This commit is contained in:
@@ -271,7 +271,9 @@ func initializeDatabase(cfg *SetupConfig) error {
|
||||
}
|
||||
}()
|
||||
|
||||
return repository.AutoMigrate(db)
|
||||
// setup 阶段使用 standard 模式(不创建默认分组)
|
||||
// 默认分组将在正常启动时根据实际 runMode 决定是否创建
|
||||
return repository.AutoMigrate(db, "standard")
|
||||
}
|
||||
|
||||
func createAdminUser(cfg *SetupConfig) error {
|
||||
|
||||
Reference in New Issue
Block a user