<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

/**
 * hold_seats was created with latin1; Arabic notes were stored as ????.
 */
class ConvertHoldSeatsTableUtf8mb4 extends Migration
{
    public function up()
    {
        if (! $this->db->tableExists('hold_seats')) {
            return;
        }

        $this->db->query(
            'ALTER TABLE `hold_seats` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci'
        );
    }

    public function down()
    {
        // Intentionally no-op: reverting to latin1 would corrupt Unicode data.
    }
}
