Update Migration Input Update Praktik Budidaya

This commit is contained in:
2026-07-08 20:57:27 +07:00
parent 3df381a66c
commit 05c2e53378
16 changed files with 857 additions and 216 deletions
@@ -41,7 +41,6 @@ return new class extends Migration
$table->string('waktu_kemunculan_terparah')->nullable();
$table->string('metode_paling_sering_dilakukan')->nullable();
$table->integer('volume_obat_obatan_permusim')->nullable();
$table->string('satuan_volume_obat_obatan')->nullable();
// 2.6 Sanitasi Kebun
$table->integer('frekuensi_sanitasi_lahan')->nullable();
$table->string('penanganan_sisa_buah_ranting')->nullable();
@@ -53,24 +52,19 @@ return new class extends Migration
$table->string('kebutuhan_air_permusim')->nullable();
// 2.8 Praktik konservasi tanah
$table->string('praktik_konservasi_tanah')->nullable();
$table->string('kebiasaan_konservasi_tanah')->nullable();
$table->string('pemahaman_manfaat_konservasi_tanah')->nullable();
$table->integer('nilai_konservasi_tanah')->nullable();
// 2.9 Struktur Biaya Produksi Per Musim
$table->decimal('upah_tenaga_kerja', 10, 2)->nullable();
$table->decimal('biaya_bibit', 10, 2)->nullable();
$table->decimal('biaya_pupuk', 10, 2)->nullable();
$table->decimal('biaya_obat_obatan', 10, 2)->nullable();
$table->decimal('biaya_sewa_alat', 10, 2)->nullable();
$table->decimal('biaya_penyediaan_air', 10, 2)->nullable();
$table->decimal('biaya_lainnya', 10, 2)->nullable();
$table->decimal('total_estimasi_biaya', 10, 2)->nullable();
// K4 Produktivitas
// 4.3 Kehilangan Akibat OPT
$table->string('estimasi_kehilangan_akibat_opt')->nullable();
$table->string('estimasi_kehilangan_akibat_hama_penyakit')->nullable();
$table->decimal('upah_tenaga_kerja', 13, 2)->nullable();
$table->decimal('biaya_bibit', 13, 2)->nullable();
$table->decimal('biaya_pupuk', 13, 2)->nullable();
$table->decimal('biaya_obat_obatan', 13, 2)->nullable();
$table->decimal('biaya_sewa_alat_produksi', 13, 2)->nullable();
$table->decimal('biaya_penyediaan_air', 13, 2)->nullable();
$table->decimal('biaya_produksi_lainnya', 13, 2)->nullable();
$table->decimal('total_estimasi_biaya_produksi', 13, 2)->nullable();
$table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null');
@@ -79,35 +73,36 @@ return new class extends Migration
$table->softDeletes();
});
Schema::create('panen', function (Blueprint $table) {
Schema::create('survey_panen', function (Blueprint $table) {
$table->id();
$table->string('uid')->unique();
$table->foreignId('petani_id')->nullable()->constrained('petani')->onDelete('set null');
// K3 PANEN & PENANGANAN AWAL
// 3.1 Cara Menetukan Kematangan
$table->integer('cara_menetukan_kematangan')->nullable();
$table->integer('dasar_penentuan_panen')->nullable();
// 3.2 Frekuensi Panen
$table->integer('frekuensi_panen_pertahun')->nullable();
$table->string('bulan_panen_utama')->nullable();
// 3.4 Hasil Panen Aktual
$table->decimal('hasil_komoditas_utama_permusim_kg', 10, 2)->nullable();
$table->decimal('hasil_komoditas_lainnya_permusim_kg', 10, 2)->nullable();
$table->string('tujuan_panen')->nullable();
$table->decimal('hasil_komoditas_utama_permusim', 10, 2)->nullable();
$table->decimal('hasil_komoditas_lainnya_permusim', 10, 2)->nullable();
$table->boolean('disimpan_untuk_sendiri')->nullable();
$table->decimal('hasil_panen_disimpan', 10, 2)->nullable();
$table->string('tujuan_disimpan')->nullable();
// 3.5 Penanganan Awal Setelah Panen
$table->integer('praktik_sortasi')->nullable();
$table->string('bentuk_sortasi')->nullable();
// 3.8 Hasil Panen Reject & Estimasi Biaya Panen
$table->integer('hasil_panen_reject')->nullable();
$table->string('jumlah_panen_reject')->nullable();
$table->string('tindakan_terhadap_panen_reject')->nullable();
$table->decimal('estimasi_biaya_panen', 10, 2)->nullable();
$table->decimal('upah_tenaga_panen', 10, 2)->nullable();
$table->decimal('biaya_pengangkutan', 10, 2)->nullable();
$table->decimal('biaya_wadah', 10, 2)->nullable();
$table->decimal('biaya_sewa_alat', 10, 2)->nullable();
$table->decimal('biaya_lainnya', 10, 2)->nullable();
$table->decimal('total_estimasi_biaya_panen', 10, 2)->nullable();
$table->string('tindakan_panen_reject')->nullable();
$table->decimal('upah_tenaga_panen', 13, 2)->nullable();
$table->decimal('biaya_pengangkutan_panen', 13, 2)->nullable();
$table->decimal('biaya_wadah-Panen', 13, 2)->nullable();
$table->decimal('biaya_sewa_alat_panen', 13, 2)->nullable();
$table->decimal('biaya_panen_lainnya', 13, 2)->nullable();
$table->decimal('total_estimasi_biaya_panen', 13, 2)->nullable();
// K4 Produktivitas
// 4.3 Kehilangan Akibat OPT
$table->string('estimasi_kehilangan_akibat_opt')->nullable();
@@ -120,43 +115,13 @@ return new class extends Migration
$table->softDeletes();
});
Schema::create('produktivitas', function (Blueprint $table) {
Schema::create('survey_produktivitas', function (Blueprint $table) {
$table->id();
$table->string('uid')->unique();
$table->foreignId('petani_id')->nullable()->constrained('petani')->onDelete('set null');
$table->foreignId('komoditas_id')->nullable()->constrained('master_komoditas')->onDelete('set null');
$table->foreignId('jenis_komoditas_id')->nullable()->constrained('jenis_komoditas')->onDelete('set null');
$table->foreignId('varietas_id')->nullable()->constrained('master_varietas')->onDelete('set null');
$table->decimal('kuantitas_pertahun', 10, 2)->nullable();
$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();
});
Schema::create('pelatihan', function (Blueprint $table) {
$table->id();
$table->string('uid')->unique();
$table->foreignId('petani_id')->nullable()->constrained('petani')->onDelete('set null');
$table->string('jenis_pelatihan');
$table->string('penyelenggara');
$table->date('tahun_pelaksanaan');
$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();
});
Schema::create('sertifikasi', function (Blueprint $table) {
$table->id();
$table->string('uid')->unique();
$table->foreignId('petani_id')->nullable()->constrained('petani')->onDelete('set null');
$table->string('jenis_sertifikasi');
$table->string('lembaga_penerbit');
$table->date('tahun_pelaksanaan');
$table->boolean('is_aktif')->default(false);
$table->decimal('kuantitas')->nullable();
$table->string('satuan')->nullable();
$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');
@@ -171,8 +136,7 @@ return new class extends Migration
public function down(): void
{
Schema::dropIfExists('praktik_budidaya');
Schema::dropIfExists('pelatihan');
Schema::dropIfExists('sertifikasi');
Schema::dropIfExists('survey_panen');
Schema::dropIfExists('produktivitas');
}
};