From bd82bba9f822c94fc90dadfbb62164258438cd41 Mon Sep 17 00:00:00 2001 From: daniel Date: Sat, 25 Jan 2025 21:45:26 -0700 Subject: [PATCH] Staging (#5603) * add kickstarter and monthly users badge (#5589) Co-authored-by: daniel * 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 Co-authored-by: Anil Kulkarni <6687139+intentionally-left-nil@users.noreply.github.com> --- app/Util/ActivityPub/Inbox.php | 1 + .../2025_01_18_061532_fix_local_statuses.php | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 database/migrations/2025_01_18_061532_fix_local_statuses.php diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index e98b48c49..ddd377a70 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -645,6 +645,7 @@ class Inbox 'profile_id' => $actor->id, 'reblog_of_id' => $parent->id, 'type' => 'share', + 'local' => false, ]); Notification::firstOrCreate( diff --git a/database/migrations/2025_01_18_061532_fix_local_statuses.php b/database/migrations/2025_01_18_061532_fix_local_statuses.php new file mode 100644 index 000000000..06b3b9fb1 --- /dev/null +++ b/database/migrations/2025_01_18_061532_fix_local_statuses.php @@ -0,0 +1,25 @@ +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 + } +};