migrations
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void {
|
||||
Schema::create('map_panen', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('land_id')->nullable();
|
||||
$table->unsignedBigInteger('plant_id')->nullable();
|
||||
$table->unsignedBigInteger('farmer_id')->nullable();
|
||||
$table->string('commodity_name');
|
||||
$table->double('weight_kg')->default(0);
|
||||
$table->date('harvest_date');
|
||||
$table->text('notes')->nullable();
|
||||
$table->string('sync_status')->default('pending');
|
||||
|
||||
// Audit Columns
|
||||
$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();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void {
|
||||
Schema::dropIfExists('map_panen');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user