From cc6a732de742d5415e0c4cae4b89afe490841a8f Mon Sep 17 00:00:00 2001 From: althaf Date: Wed, 1 Jul 2026 11:11:12 +0700 Subject: [PATCH] migrations akses pasar --- ..._06_30_135321_create_akses_pasar_table.php | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 database/migrations/2026_06_30_135321_create_akses_pasar_table.php diff --git a/database/migrations/2026_06_30_135321_create_akses_pasar_table.php b/database/migrations/2026_06_30_135321_create_akses_pasar_table.php new file mode 100644 index 0000000..3cb6e3e --- /dev/null +++ b/database/migrations/2026_06_30_135321_create_akses_pasar_table.php @@ -0,0 +1,80 @@ +id(); + $table -> string ('uid')->nullable()->unique(); + + $table->foreignId('petani_id')->nullable()->constrained('petani')->onDelete('cascade'); + + $table->tinyInteger('skor_pengalaman')->nullable()->comment('Skala 1-5'); + $table->json('saluran_terdahulu')->nullable()->comment('Menyimpan opsi Many (Koperasi, BUMDes, dll)'); + $table->string('saluran_terdahulu_lainnya')->nullable(); + + $table->string('alasan_berhenti')->nullable(); + + $table->string('praktik_fermentasi')->nullable(); + $table->text('proses_fermentasi')->nullable(); + $table->string('model_fermentasi_memungkinkan')->nullable(); + + $table->tinyInteger('skor_kesadaran_premium')->nullable()->comment('Skala 1-5'); + $table->string('sumber_info_premium')->nullable(); + + $table->time('waktu_mulai_wawancara')->nullable(); + $table->time('waktu_selesai_wawancara')->nullable(); + + $table->tinyInteger('skor_kepercayaan_responden')->nullable()->comment('Skala 1-5'); + $table->string('kehadiran_orang_lain')->nullable()->comment('Nama/siapa yang hadir mendampingi'); + $table->tinyInteger('skor_pengaruh_orang_lain')->nullable()->comment('Skala 1-5'); + + $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('harga_jual_panen', function (Blueprint $table) { + + $table->id(); + $table -> string ('uid')->nullable()->unique(); + + $table->foreignId('petani_id')->constrained('petani')->onDelete('cascade'); + + $table->string('bentuk_produk'); + + $table->integer('harga_panen_terakhir')->nullable(); + $table->integer('harga_tahun_lalu')->nullable(); + $table->integer('harga_dua_tahun_lalu')->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(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('akses_pasar'); + Schema::dropIfExists('harga_jual_panen'); + } +};