I think the deleted Team is probably the problem.

If you either A) just delete the team/group row in the db or B) call Group#delete in the console you`ll end up with orphaned objects. The safer way is to call Group#destroy http://www.nickpeters.net/2007/12/21/delete-vs-destroy/ (or just remove teams from web UI instead)

To fix the problem you`ll have to figure out where you have references to the missing team and remove those relations. Here`s an example of something similar: in another Gitorious install they had done the same thing only to a project instead. This is what we did in the console to repair it. I can`t churn out the same solution for your missing Team problem off the top of my head right now but you might be able to use this as an example/hint to get you started:

Repository.all.select{|r|r.project == nil}.count # How many repositories have missing/deleted projects?
Repository.all.select{|r|r.project == nil}.each{|r|r.delete} # Remove them

Event.all.select{|e|e.target == nil}.count # How many repositories have missing/deleted projects?
Event.all.select{|e|e.target == nil}.each{|e|e.delete} # Remove them

Favorite.all.select{|f| f.watchable == nil}.count # How many repositories have missing/deleted projects?
Favorite.all.select{|f| f.watchable == nil}.each{|f| f.delete} # Remove them

User.all.map{|u|u.favorites.select{|f|f.watchable == nil}.count} # List count of user favorites pointing to removed entities User.all.each{|u|u.favorites.select{|f|f.watchable == nil}.each{|f|f.delete}} # Remove them

(Alternatively, roll back to a recent backup of your db if possible.)

cheers,
Thomas

On 06/13/2012 10:28 AM, Thomas TREHOU wrote:
I think I have delete a team in the Gitorious Database.

--
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com


--
best regards,
Thomas Kjeldahl Nilsson
http://gitorious.com

--
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

Reply via email to