Fixed post deletion

When post was deleted foreign keys in corresponding comments weren't NULLified.
This commit is contained in:
Marcin Kurczewski
2013-10-30 17:06:35 +01:00
parent 19eea1e5b6
commit 157572d9ca
2 changed files with 11 additions and 2 deletions

View File

@ -3,7 +3,11 @@ class Model_Comment_QueryBuilder implements AbstractQueryBuilder
{
public static function build($dbQuery, $query)
{
$dbQuery->from('comment');
$dbQuery->orderBy('id')->desc();
$dbQuery
->from('comment')
->where('post_id')
->is()->not('NULL')
->orderBy('id')
->desc();
}
}