Sfoglia il codice sorgente

Merge pull request #3977 from pixelfed/staging

Staging
daniel 2 anni fa
parent
commit
809bd96293

+ 0 - 8
app/Jobs/StatusPipeline/StatusReplyPipeline.php

@@ -68,14 +68,6 @@ class StatusReplyPipeline implements ShouldQueue
             return 1;
         }
 
-        if(config('database.default') === 'mysql') {
-	        DB::transaction(function() use($reply) {
-	        	$count = DB::select( DB::raw("select id, in_reply_to_id from statuses, (select @pv := :kid) initialisation where id > @pv and find_in_set(in_reply_to_id, @pv) > 0 and @pv := concat(@pv, ',', id)"), [ 'kid' => $reply->id]);
-	        	$reply->reply_count = count($count);
-	        	$reply->save();
-	        });
-        }
-
         DB::transaction(function() use($target, $actor, $status) {
             $notification = new Notification();
             $notification->profile_id = $target->id;

+ 2 - 1
database/migrations/2022_10_07_110644_add_item_id_and_item_type_indexes_to_notifications_table.php

@@ -27,7 +27,8 @@ class AddItemIdAndItemTypeIndexesToNotificationsTable extends Migration
     public function down()
     {
         Schema::table('notifications', function (Blueprint $table) {
-            //
+            $table->dropIndex('notifications_item_id_index');
+            $table->dropIndex('notifications_item_type_index');
         });
     }
 }

+ 32 - 0
database/migrations/2022_12_20_075729_add_action_index_to_notifications_table.php

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('notifications', function (Blueprint $table) {
+            $table->index('action');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('notifications', function (Blueprint $table) {
+            $table->dropIndex('notifications_action_index');
+        });
+    }
+};