changeset 2665:81a17ef4afc0 beta

cascade delete comments when deleting repo, else it's a error preventing deletion
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 26 Jul 2012 22:08:26 +0200
parents c525d7e641a6
children c51fb1da6df2
files rhodecode/model/db.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/model/db.py	Thu Jul 26 22:03:40 2012 +0200
+++ b/rhodecode/model/db.py	Thu Jul 26 22:08:26 2012 +0200
@@ -592,7 +592,7 @@
     followers = relationship('UserFollowing', primaryjoin='UserFollowing.follows_repo_id==Repository.repo_id', cascade='all')
 
     logs = relationship('UserLog')
-    comments = relationship('ChangesetComment')
+    comments = relationship('ChangesetComment', cascade="all, delete, delete-orphan")
 
     def __unicode__(self):
         return u"<%s('%s:%s')>" % (self.__class__.__name__, self.repo_id,