View file mc-master/modules/news/helpers/news_installer.php

File size: 944B
<?php

/**
 * MobileCMS
 *
 * Open source content management system for mobile sites
 *
 * @author MobileCMS Team <[email protected]>
 * @copyright Copyright (c) 2011-2019, MobileCMS Team
 * @link https://mobilecms.pro Official site
 * @license MIT license
 */


/**
 * Хелпер установки модуля
 */
class news_installer
{

    /**
     * Установка модуля
     */
    public static function install($db)
    {
        $db->query("CREATE TABLE IF NOT EXISTS #__news (
			  `news_id` int(11) NOT NULL auto_increment,
			  `subject` varchar(100) NOT NULL,
			  `text` text NOT NULL,
			  `time` int(11) NOT NULL,
			  PRIMARY KEY  (`news_id`)
			) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
		");
    }

    /**
     * Деинсталляция модуля
     */
    public static function uninstall($db)
    {
        $db->query("DROP TABLE #__news;");
    }

}

?>