Files
database-pertani-web/database/migrations/2026_07_01_150041_update_tanaman_table.php
T

33 lines
782 B
PHP

<?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_tanaman', function (Blueprint $table) {
$table->foreignId('petani_id')->nullable()->constrained('petani')->onDelete('set null');
$table->float('umur_tanaman', 8)->nullable();
$table->string('serangan_hama')->nullable();
$table->string('penyakit_tanaman')->nullable();
$table->string('keparahan_serangan')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
}
};