<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class HwplusTicketsCreateAdjustedOffer extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {

        runtime()->createLookupTable();
        runtime()->createFactoryTable();
        $databases = \App\Models\PHPXPress\Databases::with('_host._host_type')->get();
        foreach($databases AS $database) $database->registerOnBoot();

        $xmlfile = '2026_03_08_985397_hwplus_tickets_create__adjusted_offer.xml';
        $models = unserialize(file_get_contents(database_path('/migrations/' . $xmlfile)));

        #$controller = new \App\Http\Controllers\Api\Autoflow\PHPXPress\IOController();
        #$controller->persist($models);
        
        if(1 < count($models)) throw new \Exception('have a look');
        $model = $models[0];
        
        $model->createColumn();
        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {

    }
}
