Skip to content

Commit

Permalink
add indexing migration to speedup search
Browse files Browse the repository at this point in the history
  • Loading branch information
ScuffedNewt committed Oct 9, 2023
1 parent 12963c5 commit 7107cd3
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions database/migrations/2023_10_09_152229_add_indexes_to_item_ids.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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('items', function (Blueprint $table) {
//
$table->index('item_category_id');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('items', function (Blueprint $table) {
//
$table->dropIndex('items_item_category_id_index');
});
}
};

0 comments on commit 7107cd3

Please sign in to comment.