<?php

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

return new class extends Migration
{
    public function up()
    {
        Schema::create('tax_slabs', function (Blueprint $table) {
            $table->id('TSL_Id');
            $table->unsignedBigInteger('FY_ID');
            $table->integer('From_Amt');
            $table->integer('To_Amt');
            $table->integer('TaxRate');
            $table->timestamps();
            $table->softDeletes();

            // Check which table and column exists
            // Option 1: If your financial years table is 'fyear_master' with primary key 'FY_ID'
            $table->foreign('FY_ID')
                  ->references('FY_ID')
                  ->on('fyear_master')
                  ->onDelete('cascade');
        });
    }

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