mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-31 08:50:46 +00:00
Staging (#5603)
* add kickstarter and monthly users badge (#5589) Co-authored-by: daniel <danielsupernault@gmail.com> * DM * Fix the local column for statuses to not include remote shares (#5513) * Fix the local column for statuses to not include remote shares * Chunk the migration * Refactor migration --------- Co-authored-by: Simon Laux <Simon-Laux@users.noreply.github.com> Co-authored-by: Anil Kulkarni <6687139+intentionally-left-nil@users.noreply.github.com>
This commit is contained in:
parent
fa4474bc38
commit
bd82bba9f8
2 changed files with 26 additions and 0 deletions
|
@ -645,6 +645,7 @@ class Inbox
|
||||||
'profile_id' => $actor->id,
|
'profile_id' => $actor->id,
|
||||||
'reblog_of_id' => $parent->id,
|
'reblog_of_id' => $parent->id,
|
||||||
'type' => 'share',
|
'type' => 'share',
|
||||||
|
'local' => false,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Notification::firstOrCreate(
|
Notification::firstOrCreate(
|
||||||
|
|
25
database/migrations/2025_01_18_061532_fix_local_statuses.php
Normal file
25
database/migrations/2025_01_18_061532_fix_local_statuses.php
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
DB::table('statuses')
|
||||||
|
->join('profiles', 'profiles.id', '=', 'statuses.profile_id')
|
||||||
|
->leftJoin('users', 'users.id', '=', 'profiles.user_id')
|
||||||
|
->where('statuses.local', true)
|
||||||
|
->where('statuses.type', 'share')
|
||||||
|
->whereNull('users.id')
|
||||||
|
->update(['statuses.local' => false]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
// No down migration needed since this is a data fix
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in a new issue