From 9094e9c729fd04babd29b03e47c5d016faca99c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Cmit=20Tun=C3=A7?= Date: Mon, 20 Oct 2025 14:59:00 -0300 Subject: [PATCH] Add migration for settings table: Created a new migration file to establish the settings table with necessary fields, including key, value, type, group, label, description, and soft delete functionality. Implemented indexes for key, group, and is_active columns to optimize queries. --- ...025_10_20_170041_create_settings_table.php | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 database/migrations/2025_10_20_170041_create_settings_table.php diff --git a/database/migrations/2025_10_20_170041_create_settings_table.php b/database/migrations/2025_10_20_170041_create_settings_table.php new file mode 100644 index 0000000..7a42262 --- /dev/null +++ b/database/migrations/2025_10_20_170041_create_settings_table.php @@ -0,0 +1,40 @@ +id(); + $table->string('key')->unique(); + $table->text('value')->nullable(); + $table->enum('type', ['string', 'text', 'boolean', 'integer', 'float', 'array', 'json'])->default('string'); + $table->string('group')->default('general'); + $table->string('label'); + $table->text('description')->nullable(); + $table->boolean('is_public')->default(false); + $table->boolean('is_active')->default(true); + $table->timestamps(); + $table->softDeletes(); + + $table->index('key'); + $table->index('group'); + $table->index('is_active'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('settings'); + } +};