1
0
Fork 0
forked from mirror/pixelfed

Merge pull request #3977 from pixelfed/staging

Staging
This commit is contained in:
daniel 2022-12-20 01:04:33 -07:00 committed by GitHub
commit 809bd96293
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 9 deletions

View file

@ -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;

View file

@ -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');
});
}
}

View file

@ -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');
});
}
};