mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Retroactively fix any existing settings for that table
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
c59c7337a5
commit
d24822e342
|
@ -3,6 +3,7 @@
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use App\Models\Statuslabel;
|
||||||
|
|
||||||
class ChangeDefaultLabelToNullable extends Migration
|
class ChangeDefaultLabelToNullable extends Migration
|
||||||
{
|
{
|
||||||
|
@ -17,11 +18,20 @@ class ChangeDefaultLabelToNullable extends Migration
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
Statuslabel::whereNull('default_label')
|
||||||
|
->update(['default_label' => 0]);
|
||||||
|
|
||||||
|
Statuslabel::whereNull('show_in_nav')
|
||||||
|
->update(['show_in_nav' => 0]);
|
||||||
|
|
||||||
|
|
||||||
Schema::table('status_labels', function (Blueprint $table) {
|
Schema::table('status_labels', function (Blueprint $table) {
|
||||||
$table->boolean('default_label')->nullable()->default(0)->change();
|
$table->boolean('default_label')->nullable()->default(0)->change();
|
||||||
$table->boolean('show_in_nav')->nullable()->default(0)->change();
|
$table->boolean('show_in_nav')->nullable()->default(0)->change();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue