From 9900e07ad5fb53ec70b1cc6e2a76a7b8b155255c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 22 Aug 2023 20:51:35 +1000 Subject: [PATCH] Fixes for migrations --- .../migrations/2014_10_13_000000_create_users_table.php | 4 ++-- .../2022_10_05_205645_add_indexes_to_client_hash.php | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/database/migrations/2014_10_13_000000_create_users_table.php b/database/migrations/2014_10_13_000000_create_users_table.php index bf25b3891e..56cacf4721 100644 --- a/database/migrations/2014_10_13_000000_create_users_table.php +++ b/database/migrations/2014_10_13_000000_create_users_table.php @@ -22,8 +22,8 @@ return new class extends Migration { */ public function up() { - DB::raw('SET GLOBAL innodb_file_per_table=1;'); - DB::raw('SET GLOBAL innodb_file_format=Barracuda;'); + DB::raw('SET GLOBAL innodb_file_per_table=1;')->getValue(DB::connection()->getQueryGrammar()); + DB::raw('SET GLOBAL innodb_file_format=Barracuda;')->getValue(DB::connection()->getQueryGrammar()); Schema::create('languages', function ($table) { $table->increments('id'); diff --git a/database/migrations/2022_10_05_205645_add_indexes_to_client_hash.php b/database/migrations/2022_10_05_205645_add_indexes_to_client_hash.php index ff3cef56bb..d38f4a8b92 100644 --- a/database/migrations/2022_10_05_205645_add_indexes_to_client_hash.php +++ b/database/migrations/2022_10_05_205645_add_indexes_to_client_hash.php @@ -12,18 +12,16 @@ return new class extends Migration { */ public function up() { - Schema::table('clients', function (Blueprint $table) { - $table->index([\DB::raw('client_hash(20)')]); - }); + \DB::statement('CREATE INDEX client_hash_idx ON clients (client_hash(20));'); + \DB::statement('CREATE INDEX client_contact_key_idx ON client_contacts (contact_key(20));'); + \DB::statement('CREATE INDEX vendor_contact_key_idx ON vendor_contacts (contact_key(20));'); Schema::table('client_contacts', function (Blueprint $table) { - $table->index([\DB::raw('contact_key(20)')]); $table->index('email'); }); Schema::table('vendor_contacts', function (Blueprint $table) { - $table->index([\DB::raw('contact_key(20)')]); $table->index('email'); }); }