<?php

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

return new class extends Migration
{
    /**
     * clients 테이블 Collation을 utf8mb4_unicode_ci로 변경
     * (다른 테이블과 통일하여 UNION 쿼리 호환성 확보)
     */
    public function up(): void
    {
        DB::statement('ALTER TABLE clients CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci');
    }

    /**
     * 롤백 시 원래 Collation으로 복원
     */
    public function down(): void
    {
        DB::statement('ALTER TABLE clients CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci');
    }
};
