From 0a405f9329d06f8f6fd4504352513429536d4701 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 6 Oct 2022 18:54:13 +1100 Subject: [PATCH] More indexing for DB queries --- .../2022_10_06_011344_add_key_to_products.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/database/migrations/2022_10_06_011344_add_key_to_products.php b/database/migrations/2022_10_06_011344_add_key_to_products.php index cfbce3e2753c..3b5e03f21566 100644 --- a/database/migrations/2022_10_06_011344_add_key_to_products.php +++ b/database/migrations/2022_10_06_011344_add_key_to_products.php @@ -16,6 +16,17 @@ return new class extends Migration Schema::table('products', function (Blueprint $table) { $table->index(['product_key', 'company_id']); }); + + Schema::table('companies', function (Blueprint $table) { + $table->index(['subdomain', 'portal_mode']); + $table->index(['portal_domain', 'portal_mode']); + $table->index('company_key'); + }); + + Schema::table('accounts', function (Blueprint $table) { + $table->index('key'); + }); + } /** @@ -25,8 +36,6 @@ return new class extends Migration */ public function down() { - Schema::table('products', function (Blueprint $table) { - // - }); + } };