<?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_details', function (Blueprint $table) {
            $table->id();
            $table->foreignId('solicitor_id')->nullable()
                ->constrained()
                ->cascadeOnDelete();
            $table->foreignId('claim_id')->constrained()->onDelete('cascade');

            $table->text('name_on_account');
            $table->text('sort_code');
            $table->text('account_number');
            $table->text('reference_number')->nullable();
            $table->text('bic_swift')->nullable();
            $table->text('clearing_code')->nullable();
            $table->text('iban')->nullable();

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

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