Skip to content

Commit

Permalink
Merge pull request #15783 from uberbrady/improve_user_and_location_ma…
Browse files Browse the repository at this point in the history
…nager_indexes

Improved indexes on manager_id for locations and users, including del…
  • Loading branch information
snipe authored Nov 7, 2024
2 parents a41529d + 0508318 commit 5ef3183
Showing 1 changed file with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?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->dropIndex(['manager_id']);
$table->index(['manager_id','deleted_at']);
});
Schema::table('users', function (Blueprint $table) {
$table->dropIndex(['manager_id']);
$table->index(['manager_id','deleted_at']);
});

}

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

0 comments on commit 5ef3183

Please sign in to comment.