Workaround to fix #4117

This shouldn’t be necessary, but it looks like some folks missed the migration that drops the FK for company_id
This commit is contained in:
snipe 2017-10-03 02:05:22 -07:00
parent 655484b1da
commit ef19bc7c16

View file

@ -0,0 +1,77 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class DropForeignKeys extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
try {
Schema::table('accessories', function (Blueprint $table) {
$table->dropForeign(['company_id']);
});
} catch (\Exception $e) {
//echo $e;
}
try {
Schema::table('users', function (Blueprint $table) {
$table->dropForeign(['company_id']);
});
} catch (\Exception $e) {
//echo $e;
}
try {
Schema::table('assets', function (Blueprint $table) {
$table->dropForeign(['company_id']);
});
} catch (\Exception $e) {
//echo $e;
}
try {
Schema::table('components', function (Blueprint $table) {
$table->dropForeign(['company_id']);
});
} catch (\Exception $e) {
//echo $e;
}
try {
Schema::table('consumables', function (Blueprint $table) {
$table->dropForeign(['company_id']);
});
} catch (\Exception $e) {
//echo $e;
}
try {
Schema::table('licenses', function (Blueprint $table) {
$table->dropForeign(['company_id']);
});
} catch (\Exception $e) {
//echo $e;
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}