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

	/**
	* 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']."users (
			  pk_userId int(11) NOT NULL auto_increment,
			  userName varchar(50) NOT NULL default '',
			  userPass varchar(50) NOT NULL default '',
			  userFirstName varchar(50) NOT NULL default '',
			  userLastName varchar(50) NOT NULL default '',
			  userStatus tinyint(1) NOT NULL default '0',
			  userRoot tinyint(1) NOT NULL default '0',
			  userEmail varchar(250) NOT NULL default '',
			  PRIMARY KEY  (pk_userId)
			) ENGINE=MyISAM
		";
		$result = $GLOBALS['AKB_DB']->Query($query);
	}

}
?>
