diff --git a/framework/core/src/Core/Seeders/DiscussionsTableSeeder.php b/framework/core/src/Core/Seeders/DiscussionsTableSeeder.php index e26a8b738..c7d58a5b9 100644 --- a/framework/core/src/Core/Seeders/DiscussionsTableSeeder.php +++ b/framework/core/src/Core/Seeders/DiscussionsTableSeeder.php @@ -1,7 +1,6 @@ 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\')'), + $prefix = app('db')->getTablePrefix(); + app('db')->table('users')->update([ + 'discussions_count' => app('db')->raw('(SELECT COUNT(id) FROM '.$prefix.'discussions WHERE start_user_id = '.$prefix.'users.id)'), + 'comments_count' => app('db')->raw('(SELECT COUNT(id) FROM '.$prefix.'posts WHERE user_id = '.$prefix.'users.id and type = \'comment\')'), ]); } }