<?php

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

return new class extends Migration
{
    public function up(): void
    {
        DB::table('fingerprint_machines')
            ->whereNull('connection_type')
            ->orWhere('connection_type', '')
            ->update(['connection_type' => 'local']);

        DB::table('fingerprint_machines')
            ->whereNull('protocol')
            ->orWhere('protocol', '')
            ->update(['protocol' => 'fingerspot_local']);
    }

    public function down(): void
    {
        // No down operation needed for data backfill
    }
};
