<?php

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

return new class extends Migration
{
    public function up(): void
    {
        DB::table('vouchers')
            ->where('eligible_register_date', '')
            ->orWhereNull('eligible_register_date')
            ->update(['eligible_register_date' => null]);

        DB::statement("UPDATE vouchers SET eligible_register_date = NULL WHERE eligible_register_date = ''");
    }

    public function down(): void
    {
        //
    }
};
