Merge pull request #9679 from tulsaschoolsdata/serial-number-indexes

Fixed #8486: Add index for asset serial number
This commit is contained in:
snipe 2021-06-09 17:36:06 -07:00 committed by GitHub
commit 54cb6c050a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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