Merge pull request #4022 from pixelfed/staging

Update migration
This commit is contained in:
daniel 2022-12-27 05:50:24 -07:00 committed by GitHub
commit 989f7f8386
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;