Fix comment count update.

Addresses the following error when using pqsql.

[PDOException]
  SQLSTATE[42703]: Undefined column: 7 ERROR:  column "comment" does not exist
  LINE 1: ...d) FROM posts WHERE user_id = users.id and type = "comment")
This commit is contained in:
Ciarán O'Mara 2015-03-28 05:35:09 +11:00
parent 381c23894d
commit b29d98adc4

View File

@ -131,7 +131,7 @@ class DiscussionsTableSeeder extends Seeder
$prefix = DB::getTablePrefix();
DB::table('users')->update([
'discussions_count' => DB::raw('(SELECT COUNT(id) FROM '.$prefix.'discussions WHERE start_user_id = '.$prefix.'users.id)'),
'comments_count' => DB::raw('(SELECT COUNT(id) FROM '.$prefix.'posts WHERE user_id = '.$prefix.'users.id and type = "comment")'),
'comments_count' => DB::raw('(SELECT COUNT(id) FROM '.$prefix.'posts WHERE user_id = '.$prefix.'users.id and type = \'comment\')'),
]);
}
}