mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-11 08:04:09 -08:00
Merge branch 'develop'
This commit is contained in:
commit
96c09e7264
77
database/migrations/2017_10_03_015503_drop_foreign_keys.php
Normal file
77
database/migrations/2017_10_03_015503_drop_foreign_keys.php
Normal 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()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue