<?php
require_once(dirname(__FILE__).'/../../upgrade.php');
class create_table_submittedquestions extends UPGRADE
{
	/**
	* IsAlreadyUpgraded
	* Do we need to run this classes upgrade script or not ?
	*
	* @return bool true if the upgrade has already run, otherwise false
	*/
	function IsAlreadyUpgraded()
	{
		return $this->TableExists($GLOBALS['tablePrefix'].'submittedquestions');
	}

	/**
	* Upgrade
	* Do the actual upgrade of this component. If this is successful all
	* subsequent calls to IsAlreadyUpgraded should return true
	*
	* @return void
	*/
	function Upgrade()
	{
		$query = '
			CREATE TABLE IF NOT EXISTS '.$GLOBALS['tablePrefix']."submittedquestions (
			  pk_squestId int(11) NOT NULL auto_increment,
			  sFromName varchar(100) NOT NULL default '',
			  sFromEmail varchar(250) NOT NULL default '',
			  sSubject varchar(250) NOT NULL default '',
			  sMessage text NOT NULL,
			  sDate timestamp(14) NOT NULL,
			  PRIMARY KEY  (pk_squestId)
			) ENGINE=MyISAM
		";
		$result = $GLOBALS['AKB_DB']->Query($query);
	}

}
?>
