Merge pull request #9683 from tulsaschoolsdata/9682-company-id-indexes

Thanks!
This commit is contained in:
snipe 2021-06-09 17:35:37 -07:00 committed by GitHub
commit 851e5ca96e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,88 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddCompanyIdIndexes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('accessories', function (Blueprint $table) {
$table->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']);
});
}
}