<?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('costing_overhead_detail', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('costing_id');
            $table->unsignedBigInteger('overhead_id');
            $table->decimal('qty', 15, 2);
            $table->decimal('cost_per_overhead', 15, 2);
            $table->timestamps();

            $table->foreign('costing_id')->references('id')->on('costing_overhead')->onDelete('cascade');
        });
    }

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