From 103c4325ce0341e1fcc54812489f72235dfb510c Mon Sep 17 00:00:00 2001 From: Travis Miller Date: Mon, 7 Jun 2021 11:12:48 -0500 Subject: [PATCH] Fixed #9682: Add indexes for company_id --- ...21_06_07_155436_add_company_id_indexes.php | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 database/migrations/2021_06_07_155436_add_company_id_indexes.php diff --git a/database/migrations/2021_06_07_155436_add_company_id_indexes.php b/database/migrations/2021_06_07_155436_add_company_id_indexes.php new file mode 100644 index 000000000..f4a83800c --- /dev/null +++ b/database/migrations/2021_06_07_155436_add_company_id_indexes.php @@ -0,0 +1,88 @@ +index(['company_id']); + }); + + Schema::table('action_logs', function (Blueprint $table) { + $table->index(['company_id']); + }); + + Schema::table('assets', function (Blueprint $table) { + $table->index(['company_id']); + }); + + Schema::table('components', function (Blueprint $table) { + $table->index(['company_id']); + }); + + Schema::table('consumables', function (Blueprint $table) { + $table->index(['company_id']); + }); + + Schema::table('departments', function (Blueprint $table) { + $table->index(['company_id']); + }); + + Schema::table('licenses', function (Blueprint $table) { + $table->index(['company_id']); + }); + + Schema::table('users', function (Blueprint $table) { + $table->index(['company_id']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + $table->dropIndex(['company_id']); + }); + + Schema::table('licenses', function (Blueprint $table) { + $table->dropIndex(['company_id']); + }); + + Schema::table('departments', function (Blueprint $table) { + $table->dropIndex(['company_id']); + }); + + Schema::table('consumables', function (Blueprint $table) { + $table->dropIndex(['company_id']); + }); + + Schema::table('components', function (Blueprint $table) { + $table->dropIndex(['company_id']); + }); + + Schema::table('assets', function (Blueprint $table) { + $table->dropIndex(['company_id']); + }); + + Schema::table('action_logs', function (Blueprint $table) { + $table->dropIndex(['company_id']); + }); + + Schema::table('accessories', function (Blueprint $table) { + $table->dropIndex(['company_id']); + }); + } +}