mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Clean up this migration so it runs forwards and backwards OK
This commit is contained in:
parent
873d260f55
commit
58656fbaec
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Asset;
|
||||
use App\Models\DefaultValuesForCustomFields;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
@ -14,9 +16,16 @@ class AddTypeColumnToDefaultValuesForCustomFields extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::table('default_values_for_custom_fields', function (Blueprint $table) {
|
||||
$table->text('type')->default('App\\Models\\Asset');
|
||||
$table->renameColumn('asset_model_id','item_pivot_id');
|
||||
$table->string('type')->nullable();
|
||||
$table->renameColumn('asset_model_id','item_pivot_id'); //this one works. okay. that's someting.
|
||||
//$table->text('type')->nullable(false)->change();
|
||||
});
|
||||
DefaultValuesForCustomFields::query()->update(['type' => Asset::class]);
|
||||
Schema::table('default_values_for_custom_fields', function (Blueprint $table) {
|
||||
//$table->renameColumn('asset_model_id','item_pivot_id'); //this one works. okay. that's someting.
|
||||
$table->string('type')->nullable(false)->change();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue