chore: align forest AI development setup

This commit is contained in:
2026-07-21 20:07:51 +08:00
parent b7de3c28b6
commit d2ef10763c
7 changed files with 150 additions and 3 deletions

View File

@@ -110,7 +110,8 @@ func seedProjects(tx *gorm.DB, ownerID uint) ([]models.SenlinAgentProject, error
func firstOrCreateProject(tx *gorm.DB, ownerID uint, name string, identifier string, description string) (models.SenlinAgentProject, error) {
var project models.SenlinAgentProject
err := tx.Where("owner_id = ? AND name = ?", ownerID, name).First(&project).Error
// identifier 是用户范围内的稳定唯一键;展示名称被本地修改后,重复 seed 仍复用原项目。
err := tx.Where("owner_id = ? AND identifier = ?", ownerID, identifier).First(&project).Error
if err == nil {
return project, nil
}