<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('ponds', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('user_id')->nullable(); 
            $table->foreign('user_id')->references('id')->on('users'); 
            $table->unsignedBigInteger('fish_id')->nullable(); 
            $table->foreign('fish_id')->references('id')->on('fish_types'); 
            $table->string('name');
            $table->string('slug');
            $table->date('sow_date');
            $table->double('seed_amount');
            $table->double('seed_weight');
            $table->double('survival_rate');
            $table->double('volume_pond');
            $table->double('average_weight');
            $table->double('total_feed_spent');
            $table->double('prediction');
            $table->integer('status')->comment('1: process, 2: harvest')->default(1);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('ponds');
    }
};
