Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set section to nullable on attributes #1259

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
});
}
Comment on lines +16 to +21
Copy link
Contributor

@wychoong wychoong Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alecritson this probably shouldn't be needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and I can skip something like that if desired? Principle, migrations should also be reversible. Couldn't find any code relating to that column/property, is there any future plan for it? If not, we can simple drop the column.

}
Loading