<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

/**
 * Upgrade Product module to version 3.1.0
 *
 * @author CIEXT skeleton
 */
class Product_upgrade_3_0_0 extends \Ciext\Migration\AbstractUpgrade
{

    public function up()
    {
        if (!$this->is_column_exist('product_group', 'photo_gallery')) {
            $ci = &get_instance();
            $ci->db->query('ALTER TABLE `product_group` ADD `photo_gallery` tinyint(1) DEFAULT 1 NOT NULL;');
            $ci->db->query('ALTER TABLE `product_group` ADD `video_gallery` tinyint(1) DEFAULT 1 NOT NULL;');
        }
        
        return '3.2.0';
    }
    
    public function down()
    {
        return '3.0.0';
    }

}
