id(); $table->string('nama'); $table->string('status_kepemilikan'); $table->foreignId('profile_id')->constrained('profiles'); $table->foreignId('keluarga_pengelola_id')->nullable()->constrained('keluarga')->onDelete('set null'); $table->foreignId('adat_pemilik_id')->nullable()->constrained('keluarga')->onDelete('set null'); $table->foreignId('desa_kelurahan_id')->nullable()->constrained('master_desa_kelurahan'); $table->text('path')->nullable(); $table->integer('luas_lahan')->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('map_tanaman', function (Blueprint $table) { $table->id(); $table->string('nama'); $table->foreignId('komoditas_id')->constrained('master_komoditas')->onDelete('set null'); $table->foreignId('profile_id')->constrained('profiles')->onDelete('set null'); $table->foreignId('lahan_id')->constrained('map_lahan')->onDelete('set null'); $table->float('latitude')->nullable(); $table->float('longitude')->nullable(); $table->string('kondisi_tanaman')->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(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('map_tanaman'); Schema::dropIfExists('map_lahan'); } };