<?php

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

return new class extends Migration
{
    /**
     * Run the migrations - change collation to binary to properly handle Ñ vs N
     */
    public function up(): void
    {
        DB::statement('ALTER TABLE numerology_letters MODIFY COLUMN letter VARCHAR(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL');
    }

    /**
     * Reverse the migrations - revert to unicode collation
     */
    public function down(): void
    {
        DB::statement('ALTER TABLE numerology_letters MODIFY COLUMN letter VARCHAR(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL');
    }
};
