From 4fcf5ac7dae2819e6b19d1d63d7d865d08d056be Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Wed, 6 Nov 2024 21:19:41 +0000 Subject: [PATCH] Add new indexes to locations and users for faster manager lookups --- ...d_manager_indexes_to_location_and_user.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 database/migrations/2024_11_06_211457_add_manager_indexes_to_location_and_user.php diff --git a/database/migrations/2024_11_06_211457_add_manager_indexes_to_location_and_user.php b/database/migrations/2024_11_06_211457_add_manager_indexes_to_location_and_user.php new file mode 100644 index 0000000000..d1a151c126 --- /dev/null +++ b/database/migrations/2024_11_06_211457_add_manager_indexes_to_location_and_user.php @@ -0,0 +1,34 @@ +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']); + }); + } +};