<?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('des_post_book', function (Blueprint $table) {

            $table->id('Dpb_id');

            $table->decimal('Perm_Post', 15, 2)->nullable();
            $table->decimal('Temp_Post', 15, 2)->nullable();

            $table->date('Date')->nullable();

            $table->unsignedBigInteger('Dsg_id');

            $table->foreign('Dsg_id')
                ->references('Dsg_Id')
                ->on('designation_master')
                ->onDelete('cascade');

            $table->timestamps();
            $table->softDeletes();
        });
    }

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