Panen and include all support

This commit is contained in:
2026-06-08 11:23:33 +07:00
parent f11be9d288
commit a355a1d1d8
7 changed files with 411 additions and 24 deletions
@@ -8,11 +8,11 @@ return new class extends Migration {
public function up(): void {
Schema::create('map_panen', function (Blueprint $table) {
$table->id();
$table->string('uid')->unique()->nullable(); // Bagus untuk sinkronisasi Dexie offline
$table->string('title'); // Judul aktivitas panen
$table->unsignedBigInteger('land_id')->nullable();
$table->unsignedBigInteger('plant_id')->nullable();
$table->unsignedBigInteger('farmer_id')->nullable();
$table->string('commodity_name');
$table->double('weight_kg')->default(0);
$table->text('land_description')->nullable(); // Deskripsi kondisi lahan saat panen
$table->date('harvest_date');
$table->text('notes')->nullable();
$table->string('sync_status')->default('pending');
@@ -0,0 +1,38 @@
<?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('panen_tanaman', function (Blueprint $bluePrint) {
$bluePrint->id();
$bluePrint->foreignId('panen_id')
->constrained('panen')
->onDelete('cascade');
$bluePrint->unsignedBigInteger('tanaman_id');
$bluePrint->string('commodity_name');
$bluePrint->string('sync_status', 50)->nullable()->default('synced');
$bluePrint->decimal('weight_kg', 10, 2); // Menggunakan decimal agar mendukung angka pecahan (misal: 10.5 kg)
$bluePrint->timestamps();
$bluePrint->softDeletes(); // Menambahkan kolom deleted_at untuk fitur SoftDeletes
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('panen_tanamen');
}
};