<?php
require_once(dirname(__FILE__).'/../../upgrade.php');
class create_newss_table 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'].'newss');
	}

	/**
	* 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 `".$GLOBALS['tablePrefix']."newss` (
			  `newsid` int(11) NOT NULL auto_increment,
			  `title` varchar(200) NOT NULL default '',
			  `content` longtext NOT NULL,
			  `lastupdated` datetime NOT NULL,
			  `visible` tinyint(1) NOT NULL default '0',
			  `userid` int(11) NOT NULL default '0',
			  PRIMARY KEY  (`newsid`)
			) ENGINE=MyISAM
		";			

		$result = $GLOBALS['AKB_DB']->Query($query);
	}

}
?>
