<?php

namespace AC_SYNC\Includes\Classes\Sql\Version {
    if (!defined('ABSPATH'))
        exit; // Exit if accessed directly
    class Action_Wear_Sql_Version_1_0_3 extends Action_Wear_Sql_Version_Abstract implements Action_Wear_Sql_Version_Interface
    {

        public static function versioningScript()
        {
            // change actionwear_categories column id_action and parent_id_actionwear to VARCHAR(255)
            global $wpdb;
            $wpdb->query("ALTER TABLE {$wpdb->prefix}actionwear_categories MODIFY COLUMN id_actionwear VARCHAR(255);");
            $wpdb->query("ALTER TABLE {$wpdb->prefix}actionwear_categories MODIFY COLUMN parent_id_actionwear VARCHAR(255);");

            // change camac_category_id to VARCHAR(255) in actionwear_categories_associations
            $wpdb->query("ALTER TABLE {$wpdb->prefix}actionwear_categories_associations MODIFY COLUMN camac_category_id VARCHAR(255);");

            // change id_category to VARCHAR(255) in actionwear_categories_product
            $wpdb->query("ALTER TABLE {$wpdb->prefix}actionwear_categories_product MODIFY COLUMN id_category VARCHAR(255);");

        }
    }
}
