?
Path : /home/admin/public_html/old/administrator/components/com_jupgrade/extensions/ |
Current File : /home/admin/public_html/old/administrator/components/com_jupgrade/extensions/com_adminpraise.php |
<?php /** * jUpgrade * * @version $Id: * @package MatWare * @subpackage com_jupgrade * @copyright Copyright 2006 - 2011 Matias Aguirre. All rights reserved. * @license GNU General Public License version 2 or later. * @author Matias Aguirre <maguirre@matware.com.ar> * @link http://www.matware.com.ar */ // Check to ensure this file is within the rest of the framework defined('JPATH_BASE') or die(); /** * jUpgrade class for Adminpraise migration * * This class migrates the Adminpraise extension * * @since 1.1.0 */ class jUpgradeComponentAdminpraise extends jUpgradeExtensions { /** * Check if extension migration is supported. * * @return boolean * @since 1.1.0 */ protected function detectExtension() { return true; } /** * Migrate tables * * @return boolean * @since 1.1.0 */ public function migrateExtensionCustom() { // name -> title $query = "ALTER TABLE `#__adminpraise_menu` CHANGE `name` `title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL"; $this->db_new->setQuery($query); //$this->db_new->query(); // Check for query error. $error = $this->db_new->getErrorMsg(); if ($error) { throw new Exception($error); } // parent -> parent_id $query = "ALTER TABLE `#__adminpraise_menu` CHANGE `parent` `parent_id` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0'"; $this->db_new->setQuery($query); //$this->db_new->query(); // Check for query error. $error = $this->db_new->getErrorMsg(); if ($error) { throw new Exception($error); } return true; } }