From 28b450fd3cb11857235540447abd15b37bdc6ed4 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Mon, 27 May 2024 15:38:42 +0100 Subject: [PATCH] Add index to 'parent_id' for users with large number of locations --- ...43554_add_parent_id_index_to_locations.php | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 database/migrations/2024_05_27_143554_add_parent_id_index_to_locations.php diff --git a/database/migrations/2024_05_27_143554_add_parent_id_index_to_locations.php b/database/migrations/2024_05_27_143554_add_parent_id_index_to_locations.php new file mode 100644 index 0000000000..2aef11918f --- /dev/null +++ b/database/migrations/2024_05_27_143554_add_parent_id_index_to_locations.php @@ -0,0 +1,33 @@ +index('parent_id'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('locations', function (Blueprint $table) { + // + $table->dropIndex('locations_parent_id_index'); + }); + } +}