perf: 优化索引

This commit is contained in:
kuaifan 2024-11-02 09:44:47 +08:00
parent cbfcdbf836
commit ebe953cf63
7 changed files with 42 additions and 6 deletions

View File

@ -23,7 +23,7 @@ class AddIndexToProjectTasksTable extends Migration
/**
* Reverse the migrations.
*
* @return voidw
* @return void
*/
public function down()
{

View File

@ -23,7 +23,7 @@ class AddIndexToProjectTaskUsersTable extends Migration
/**
* Reverse the migrations.
*
* @return voidw
* @return void
*/
public function down()
{

View File

@ -25,7 +25,7 @@ class AddIndexSome20231217 extends Migration
/**
* Reverse the migrations.
*
* @return voidw
* @return void
*/
public function down()
{

View File

@ -110,7 +110,7 @@ class UpdateOwnerAddIndexSome20231217 extends Migration
/**
* Reverse the migrations.
*
* @return voidw
* @return void
*/
public function down()
{

View File

@ -21,7 +21,7 @@ class AddIndexSome20240315 extends Migration
/**
* Reverse the migrations.
*
* @return voidw
* @return void
*/
public function down()
{

View File

@ -22,7 +22,7 @@ class AddIndexSome20240317 extends Migration
/**
* Reverse the migrations.
*
* @return voidw
* @return void
*/
public function down()
{

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddIndexSome20241102 extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('web_socket_dialog_msgs', function (Blueprint $table) {
$table->index(['dialog_id', 'deleted_at']);
});
Schema::table('deleteds', function (Blueprint $table) {
$table->index(['type', 'userid']);
});
Schema::table('report_receives', function (Blueprint $table) {
$table->index(['userid', 'read', 'rid']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// 回滚数据 - 无法回滚
}
}