Update Praktik Budidaya & Pendidikan Pelatihan
This commit is contained in:
@@ -0,0 +1,178 @@
|
||||
<?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('praktik_budidaya', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uid')->unique();
|
||||
// K2 PRAKTIK BUDIDAYA
|
||||
// 2.2 Persiapan Lahan & Penanaman
|
||||
$table->foreignID('petani_id')->constrained('petani')->onDelete('cascade');
|
||||
$table->string('tenaga_kerja')->nullable();
|
||||
// 2.3 Frekuensi Pemangkasan
|
||||
$table->integer('frekuensi_pemangkasan_utama')->nullable();
|
||||
$table->jsonb('teknik_pemangkasan')->nullable();
|
||||
$table->string('frekuensi_pemangkasan_penaung')->nullable();
|
||||
$table->string('penyerbukan_manual')->nullable();
|
||||
$table->string('deskripsi_penyerbukan_manual')->nullable();
|
||||
$table->string('tingkat_keberhasilan_penyerbukan')->nullable();
|
||||
// 2.4 Praktik Pemupukan
|
||||
$table->integer('pemberian_pupuk')->nullable();
|
||||
$table->string('jenis_pupuk')->nullable();
|
||||
$table->string('frekuensi_pemberian_pupuk')->nullable();
|
||||
$table->decimal('estimasi_dosis_pupuk_organik', 10, 2)->nullable();
|
||||
$table->decimal('estimasi_dosis_pupuk_anorganik', 10, 2)->nullable();
|
||||
$table->string('waktu_pemberian_pupuk')->nullable();
|
||||
$table->string('cara_pemberian_pupuk')->nullable();
|
||||
// 2.5 Pengendalian Organisme Pengganggu Tumbuhan (OPT)
|
||||
$table->integer('metode_penanganan_opt')->nullable();
|
||||
$table->string('jenis_hama')->nullable();
|
||||
$table->string('jenis_penyakit')->nullable();
|
||||
$table->string('intensitas_serangan')->nullable();
|
||||
$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();
|
||||
$table->integer('penanganan_gulma')->nullable();
|
||||
// 2.7 Pengelolaan Air & irigasi
|
||||
$table->integer('kondisi_pengelolaan_air')->nullable();
|
||||
$table->string('sumber_air')->nullable();
|
||||
$table->string('sistem_irigasi')->nullable();
|
||||
$table->string('kebutuhan_air_permusim')->nullable();
|
||||
|
||||
// 2.8 Praktik konservasi tanah
|
||||
$table->string('praktik_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->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('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();
|
||||
// 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();
|
||||
// 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();
|
||||
// K4 Produktivitas
|
||||
// 4.3 Kehilangan Akibat OPT
|
||||
$table->string('estimasi_kehilangan_akibat_opt')->nullable();
|
||||
$table->string('estimasi_kehilangan_akibat_hama_penyakit')->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('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->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();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('praktik_budidaya');
|
||||
Schema::dropIfExists('pelatihan');
|
||||
Schema::dropIfExists('sertifikasi');
|
||||
Schema::dropIfExists('produktivitas');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user