mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Update migration
This commit is contained in:
parent
9dd58bbbc3
commit
3f9e113cb7
1 changed files with 10 additions and 8 deletions
|
@ -15,14 +15,16 @@ return new class extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
Hashtag::chunkById(100, function($hashtags) {
|
||||
foreach($hashtags as $hashtag) {
|
||||
$count = DB::table('status_hashtags')->whereHashtagId($hashtag->id)->count();
|
||||
$hashtag->cached_count = $count;
|
||||
$hashtag->can_trend = true;
|
||||
$hashtag->can_search = true;
|
||||
$hashtag->save();
|
||||
}
|
||||
Hashtag::withoutEvents(function() {
|
||||
Hashtag::chunkById(50, function($hashtags) {
|
||||
foreach($hashtags as $hashtag) {
|
||||
$count = DB::table('status_hashtags')->whereHashtagId($hashtag->id)->count();
|
||||
$hashtag->cached_count = $count;
|
||||
$hashtag->can_trend = true;
|
||||
$hashtag->can_search = true;
|
||||
$hashtag->save();
|
||||
}
|
||||
}, 'id');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue