From 9e748fc8cd5956c5a75f77be7b9f0da6d1399be6 Mon Sep 17 00:00:00 2001 From: ahmadafriadi Date: Tue, 19 May 2026 13:24:38 +0700 Subject: [PATCH] Update master Varietas --- .../2026_02_20_110207_create_komoditas_table.php | 15 +++++++++++++++ .../2026_02_20_131504_create_lahans_table.php | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/database/migrations/2026_02_20_110207_create_komoditas_table.php b/database/migrations/2026_02_20_110207_create_komoditas_table.php index 4238135..f495045 100644 --- a/database/migrations/2026_02_20_110207_create_komoditas_table.php +++ b/database/migrations/2026_02_20_110207_create_komoditas_table.php @@ -22,6 +22,20 @@ return new class extends Migration $table->timestamps(); $table->softDeletes(); }); + + Schema::create('master_varietas', function (Blueprint $table) { + $table->id(); + $table->foreignId('komoditas_id')->constrained('master_komoditas')->onDelete('cascade'); + $table->string('nama'); + $table->text('deskripsi')->unique(); + + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); + + $table->timestamps(); + $table->softDeletes(); + }); } /** @@ -30,5 +44,6 @@ return new class extends Migration public function down(): void { Schema::dropIfExists('master_komoditas'); + Schema::dropIfExists('master_varietas'); } }; diff --git a/database/migrations/2026_02_20_131504_create_lahans_table.php b/database/migrations/2026_02_20_131504_create_lahans_table.php index 70f30e5..9469b3e 100644 --- a/database/migrations/2026_02_20_131504_create_lahans_table.php +++ b/database/migrations/2026_02_20_131504_create_lahans_table.php @@ -21,7 +21,7 @@ return new class extends Migration $table->foreignId('adat_pemilik_id')->nullable()->constrained('adat')->onDelete('set null'); $table->foreignId('desa_kelurahan_id')->nullable()->constrained('master_desa_kelurahan'); - $table->text('path')->nullable(); + $table->jsonb('path')->nullable(); $table->float('luas_lahan', 8)->nullable(); @@ -38,6 +38,7 @@ return new class extends Migration $table->string('nama'); $table->foreignId('komoditas_id')->constrained('master_komoditas')->onDelete('set null'); + $table->foreignId('varietas_id')->constrained('master_varietas')->onDelete('set null'); $table->foreignId('profile_id')->constrained('profiles')->onDelete('set null'); $table->foreignId('lahan_id')->constrained('map_lahan')->onDelete('set null');