petani
This commit is contained in:
@@ -52,6 +52,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('petanis');
|
||||
Schema::dropIfExists('petani');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?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::table('map_lahan', function (Blueprint $table) {
|
||||
$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->float('umur_tanaman', 8)->nullable();
|
||||
$table->float('umur_kebun', 8)->nullable();
|
||||
|
||||
$table->integer('jumlah_tanaman')->nullable();
|
||||
|
||||
$table->string('kondisi_tanaman')->nullable();
|
||||
$table->string('hama_tanaman')->nullable();
|
||||
$table->string('penyakit_tanaman')->nullable();
|
||||
$table->string('keparahan_serangan')->nullable();
|
||||
|
||||
// TODO:
|
||||
// komoditas lainnya dan tanaman penaung
|
||||
});
|
||||
|
||||
Schema::table('petani', function (Blueprint $table) {
|
||||
$table->foreignId('profile_id')->nullable()->constrained('profiles')->onDelete('set null');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user