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

/**
 * Upgrade module to version 1.0.12
 *
 * @author Roman Ratsun
 */
class resmng_upgrade_1_0_8 extends Abstract_upgrade
{

    public function up()
    {
        $ci = & get_instance();
        if (!$this->is_column_exist('resource_type_page_template', 'mime_type')) {
            $ci->db->query("ALTER TABLE `resource_type_page_template` ADD `mime_type` int(11) NOT NULL DEFAULT '1';");
            $ci->db->update('resource_type_page_template', ['mime_type' => 1]);
        }

        return '1.0.12';
    }

    public function down()
    {
        return '1.0.8';
    }
}
