<?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('egg_prices', function (Blueprint $table) {
            $table->id();
            $table->string('name', 50);
            $table->foreignId('unit_id')->constrained()->cascadeOnDelete();
            $table->unsignedInteger('price');
            $table->timestamp('created_at')->useCurrent();
            $table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
            $table->softDeletes();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('egg_prices');
    }
};
