1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-23 00:05:29 +00:00

Update migration

This commit is contained in:
Daniel Supernault 2022-12-27 05:49:36 -07:00
parent 898911f9a9
commit bf86ed6ff7
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -16,7 +16,7 @@ return new class extends Migration
public function up() public function up()
{ {
Hashtag::withoutEvents(function() { Hashtag::withoutEvents(function() {
Hashtag::chunkById(50, function($hashtags) { Hashtag::whereNotNull('cached_count')->chunkById(50, function($hashtags) {
foreach($hashtags as $hashtag) { foreach($hashtags as $hashtag) {
$count = DB::table('status_hashtags')->whereHashtagId($hashtag->id)->count(); $count = DB::table('status_hashtags')->whereHashtagId($hashtag->id)->count();
$hashtag->cached_count = $count; $hashtag->cached_count = $count;