<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('bank_withdraws', function (Blueprint $table) {
            $table->id();
            $table->string('branch_id')->comment('branches.id')->nullable();
            $table->foreignId('bank_account_id')->constrained('bank_accounts')->onDelete('cascade');
            $table->integer('amount')->nullable();
            $table->date('date')->nullable();
            $table->text('note')->nullable();
            $table->string('attachment')->nullable();
            $table->string('transaction_id')->nullable();
            $table->string('check_number')->nullable();
            $table->unsignedBigInteger('created_by')->nullable();
            $table->unsignedBigInteger('updated_by')->nullable();
            $table->timestamps();
        });
    }

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