From a93254430c3ab643175d9caec20d60bb5a2e3bd2 Mon Sep 17 00:00:00 2001 From: Zero Date: Fri, 26 Nov 2021 15:10:39 +0800 Subject: [PATCH] Add index for user IP address --- ...021_11_26_070438_add_index_for_user_ip.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 database/migrations/2021_11_26_070438_add_index_for_user_ip.php diff --git a/database/migrations/2021_11_26_070438_add_index_for_user_ip.php b/database/migrations/2021_11_26_070438_add_index_for_user_ip.php new file mode 100644 index 000000000..c4681a9a3 --- /dev/null +++ b/database/migrations/2021_11_26_070438_add_index_for_user_ip.php @@ -0,0 +1,32 @@ +index('ip', 'ip_address_index'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('activities', function (Blueprint $table) { + $table->dropIndex('ip_address_index'); + }); + } +}