Skip to content

Commit

Permalink
Rename migration file and update custom fields table structure to inc…
Browse files Browse the repository at this point in the history
…lude settings and adjust value types
  • Loading branch information
ManukMinasyan committed Feb 7, 2025
1 parent 76c7d91 commit e4fd18f
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 59 deletions.
104 changes: 52 additions & 52 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
use Relaticle\CustomFields\Models\CustomField;
use Relaticle\CustomFields\Support\Utils;

return new class extends Migration
{
return new class extends Migration {
public function up(): void
{
/**
Expand All @@ -36,6 +35,8 @@ public function up(): void
$table->boolean('active')->default(true);
$table->boolean('system_defined')->default(false);

$table->json('settings')->nullable();

$table->unique($uniqueColumns);

$table->timestamps();
Expand Down Expand Up @@ -68,6 +69,7 @@ public function up(): void
$table->boolean('active')->default(true);
$table->boolean('system_defined')->default(false);

$table->json('settings')->nullable();

$table->unique($uniqueColumns);

Expand Down Expand Up @@ -117,8 +119,8 @@ public function up(): void
->constrained()
->cascadeOnDelete();

$table->string('string_value')->nullable();
$table->text('text_value')->nullable();
$table->text('string_value')->nullable();
$table->longText('text_value')->nullable();
$table->boolean('boolean_value')->nullable();
$table->integer('integer_value')->nullable();
$table->double('float_value')->nullable();
Expand All @@ -132,9 +134,9 @@ public function up(): void

public function down(): void
{
Schema::dropIfExists(config('custom-fields.table_names.custom_field_sections'));
Schema::dropIfExists(config('custom-fields.table_names.custom_fields'));
Schema::dropIfExists(config('custom-fields.table_names.custom_field_options'));
Schema::dropIfExists(config('custom-fields.table_names.custom_field_values'));
Schema::dropIfExists(config('custom-fields.table_names.custom_field_options'));
Schema::dropIfExists(config('custom-fields.table_names.custom_fields'));
Schema::dropIfExists(config('custom-fields.table_names.custom_field_sections'));
}
};

0 comments on commit e4fd18f

Please sign in to comment.