-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1738 from bakaphp/feat-download-all-zoho-leads
refact: add new index
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
database/migrations/2024_07_27_144141_update_company_branch_index.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class () extends Migration { | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::table('users_associated_company', function (Blueprint $table) { | ||
$table->index(['companies_id', 'is_deleted']); | ||
}); | ||
|
||
Schema::table('users_associated_apps', function (Blueprint $table) { | ||
$table->index(['apps_id', 'companies_id']); | ||
}); | ||
|
||
Schema::table('companies_branches', function (Blueprint $table) { | ||
$table->index('is_deleted'); | ||
$table->index(['companies_id', 'is_deleted']); | ||
$table->index(['uuid', 'companies_id', 'is_deleted']); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::table('users_associated_company', function (Blueprint $table) { | ||
$table->dropIndex(['companies_id', 'is_deleted']); | ||
}); | ||
|
||
Schema::table('users_associated_apps', function (Blueprint $table) { | ||
$table->dropIndex(['apps_id', 'companies_id']); | ||
}); | ||
|
||
Schema::table('companies_branches', function (Blueprint $table) { | ||
$table->dropIndex(['is_deleted']); | ||
$table->dropIndex(['companies_id', 'is_deleted']); | ||
$table->dropIndex(['uuid', 'companies_id', 'is_deleted']); | ||
}); | ||
} | ||
}; |