mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
Merge pull request #9683 from tulsaschoolsdata/9682-company-id-indexes
Thanks!
This commit is contained in:
commit
851e5ca96e
|
@ -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']);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue