chore: align forest AI development setup
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user