<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

return new class extends Migration
{
    public function up(): void
    {
        DB::table('transfer_requests')
            ->where('type', 'in_house')
            ->update(['type' => 'local']);

        DB::table('transactions')
            ->where('source', 'in_house_transfer')
            ->update(['source' => 'local_transfer']);
    }

    public function down(): void
    {
        DB::table('transfer_requests')
            ->where('type', 'local')
            ->update(['type' => 'in_house']);

        DB::table('transactions')
            ->where('source', 'local_transfer')
            ->update(['source' => 'in_house_transfer']);
    }
};
