<?php

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

/**
 * Upgrade Slider module to version 1.0.0
 *
 * @author CIEXT skeleton
 */
class Slider_upgrade_0 extends \Ciext\Migration\AbstractUpgrade
{

    public function up()
    {
        if (!$this->is_column_exist('slider', 'is_yt_video')) {
            $ci = &get_instance();
            $ci->db->query('ALTER TABLE `slider` ADD `is_yt_video` tinyint(1);');
            $ci->db->query('ALTER TABLE `slider_slide` ADD `yt_video` varchar(255) CHARACTER SET utf8;');
        }
        
        return '1.0.0';
    }
    
    public function down()
    {
        return '0';
    }

}
