add index

This commit is contained in:
Easy 2022-06-27 00:05:17 +08:00
parent a218d5c68d
commit 034e93d3c7
1 changed files with 32 additions and 0 deletions

View File

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