Skip to content

Commit

Permalink
Allow section to be null on attributes (#1259)
Browse files Browse the repository at this point in the history
  • Loading branch information
netzknecht authored and alecritson committed Sep 29, 2023
1 parent 472f4b7 commit f7e9eeb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function rules()
'attribute.searchable' => 'nullable|boolean',
'attribute.filterable' => 'nullable|boolean',
'attribute.configuration' => 'nullable|array',
'attribute.section' => 'string',
'attribute.section' => 'nullable|string',
'attribute.system' => 'boolean',
'attribute.type' => 'required',
'attribute.validation_rules' => 'nullable|string',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Lunar\Base\Migration;

class SetSectionToNullableOnAttributes extends Migration
{
public function up()
{
Schema::table($this->prefix.'attributes', function (Blueprint $table) {
$table->string('section')->nullable()->change();
});
}

public function down()
{
Schema::table($this->prefix.'attributes', function ($table) {
$table->string('section')->nullable(false)->change();
});
}
}

0 comments on commit f7e9eeb

Please sign in to comment.