Skip to content

Commit

Permalink
Merge pull request #15780 from uberbrady/add_manager_indexes
Browse files Browse the repository at this point in the history
Add new indexes to locations and users for faster manager lookups
  • Loading branch information
snipe authored Nov 6, 2024
2 parents aa168fc + 4fcf5ac commit a41529d
Showing 1 changed file with 34 additions and 0 deletions.
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.
*/
public function up(): void
{
Schema::table('locations', function (Blueprint $table) {
$table->index('manager_id');
});
Schema::table('users', function (Blueprint $table) {
$table->index('manager_id');
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('locations', function (Blueprint $table) {
$table->dropIndex(['manager_id']);
});
Schema::table('users', function (Blueprint $table) {
$table->dropIndex(['manager_id']);
});
}
};

0 comments on commit a41529d

Please sign in to comment.