<?php

if ( ! defined( 'ABSPATH' ) ) exit;

use Flyerimage\Core\Database\MigrationBase;

return new class extends MigrationBase {
    public function up() {
        $table      = \Flyerimage\App\Constants\ITables::$FLYER_IMAGES;
        $table_name = $this->table_name($table);
        // TEXT (64KB) is too small for v3 canvas JSON that includes base64 image data
        $this->queries[] = "ALTER TABLE `{$table_name}` MODIFY COLUMN `flyer_configs` LONGTEXT NULL DEFAULT NULL";
    }

    public function down() {
        $table      = \Flyerimage\App\Constants\ITables::$FLYER_IMAGES;
        $table_name = $this->table_name($table);
        $this->queries[] = "ALTER TABLE `{$table_name}` MODIFY COLUMN `flyer_configs` TEXT NULL DEFAULT NULL";
    }
};
