<?php
/**
 * @version		1.2 feedback $
 * @package		feedback
 * @copyright	Copyright © 2010 Mertonium. All rights reserved.
 * @license		GNU/GPL
 * @author		Mertonium
 * @author mail	john@mertonium.com
 * @website		http://mertonium.com
 *
 *
 * @MVC architecture generated by MVC generator tool at http://www.alphaplug.com
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

// Your custom code here
function com_install() {
	$db =& JFactory::getDBO();
	
	$sql = 'SHOW COLUMNS FROM `#__feedback`';
	$db->setQuery($sql);
	$columns = $db->loadResultArray();
	
	if(!in_array('time_split',$columns)) {
		$sql = 'ALTER TABLE `#__feedback` ADD `time_split` INT NOT NULL;';
		$db->setQuery($sql);
		$db->query();
	}
	
	if(!in_array('user_ip',$columns)) {
		$sql = 'ALTER TABLE `#__feedback` ADD `user_ip` VARCHAR( 25 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;';
		$db->setQuery($sql);
		$db->query();
	}
}
?>