Skip to content

A self-hosted media server and file management system

feat: server config table

aminnausind8bb624fa698
diff --git a/app/Models/ServerConfig.php b/app/Models/ServerConfig.php
new file mode 100644
index 00000000..473edc4a
--- /dev/null
+++ b/app/Models/ServerConfig.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class ServerConfig extends Model {
+ /**
+ * key -> string (pk) (unique) (index)
+ * value -> text
+ * default_value -> text
+ * type -> enum ('string', 'boolean', 'integer', 'array', 'float')
+ * group -> enum ('scanning', 'metadata', 'media', 'performance', 'storage')
+ *
+ * created_at -> timestamptz (nullable)
+ * updated_at -> timestamptz (nullable)
+ */
+
+ protected $fillable = [
+ 'value',
+ 'default_value',
+ 'type',
+ 'group'
+ ];
+}
diff --git a/database/migrations/2026_05_04_040812_create_server_config_table.php b/database/migrations/2026_05_04_040812_create_server_config_table.php
new file mode 100644
index 00000000..286ed972
--- /dev/null
+++ b/database/migrations/2026_05_04_040812_create_server_config_table.php
@@ -0,0 +1,28 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration {
+ /**
+ * Run the migrations.
+ */
+ public function up(): void {
+ Schema::create('server_config', function (Blueprint $table) {
+ $table->string("key")->unique();
+ $table->text('value');
+ $table->text('default_value');
+ $table->enum("type", ['string', 'boolean', 'integer', 'array', 'float']);
+ $table->enum('group', ['scanning', 'metadata', 'media', 'performance', 'storage'])->index();
+ $table->timestampsTz();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void {
+ Schema::dropIfExists('server_config');
+ }
+};