Added auto_add_to_fieldsets field

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-04-25 15:51:36 -07:00
parent efc0929bbc
commit 07336bbc6a
2 changed files with 37 additions and 0 deletions

View file

@ -52,6 +52,7 @@ class CustomField extends Model
'name' => 'required|unique:custom_fields', 'name' => 'required|unique:custom_fields',
'element' => 'required|in:text,listbox,textarea,checkbox,radio', 'element' => 'required|in:text,listbox,textarea,checkbox,radio',
'field_encrypted' => 'nullable|boolean', 'field_encrypted' => 'nullable|boolean',
'auto_add_to_fieldsets' => 'boolean',
]; ];
/** /**
@ -69,6 +70,8 @@ class CustomField extends Model
'show_in_email', 'show_in_email',
'is_unique', 'is_unique',
'display_in_user_view', 'display_in_user_view',
'auto_add_to_fieldsets',
]; ];
/** /**

View file

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddAutoaddToCustomfields extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('custom_fields', function (Blueprint $table) {
$table->boolean('auto_add_to_fieldsets')->nullable()->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('custom_fields', function (Blueprint $table) {
if (Schema::hasColumn('custom_fields', 'auto_add_to_fieldsets')) {
$table->dropColumn('auto_add_to_fieldsets');
}
});
}
}