Ensure project tags are removed when the project is removed (PR #3250)

This commit is contained in:
Frederic Guillot
2017-05-12 16:26:11 -04:00
parent 5b7e137f76
commit 3cf9484644
3 changed files with 79 additions and 1 deletions

View File

@@ -462,7 +462,13 @@ class ProjectModel extends Base
*/
public function remove($project_id)
{
return $this->db->table(self::TABLE)->eq('id', $project_id)->remove();
$this->db->startTransaction();
$this->db->table(TagModel::TABLE)->eq('project_id', $project_id)->remove();
$result = $this->db->table(self::TABLE)->eq('id', $project_id)->remove();
$this->db->closeTransaction();
return $result;
}
/**