<?php

class Upgrade_Base extends Upgrade {
	
	var $platfom = 'scs';
	
	var $mname = 'base';
	
	/**
	 * upgrade the module version
	 * @param string 	$start_version 	the start version, automaticaly prooceed to the next
	 *
	 * @return mixed 	true if the version jump was successful, else an array with an error code and an error message
	 * 					array( 'error_code', 'error_msg' )
	 **/
	function oneStepUpgrade($start_version) {
		
		switch($start_version) {
			case "3.5.0.3":
				$i = 0;
				
				$content = "create table conference_room (
id						BIGINT AUTO_INCREMENT PRIMARY KEY NOT NULL,
idCal					BIGINT NOT NULL,
idCourse				BIGINT NOT NULL,
idSt					BIGINT NOT NULL,
name					VARCHAR(255),
room_type				VARCHAR(255),
starttime				BIGINT,
endtime					BIGINT,
meetinghours			INT,
maxparticipants			INT,
INDEX (idCourse)
)";
				
				if(!$this->db_man->query($content)) return $this->_getErrArray($start_version, ++$i);
				
				$content = "create table conference_dimdim (
id						BIGINT AUTO_INCREMENT PRIMARY KEY NOT NULL,
idConference			BIGINT NOT NULL,
confkey					VARCHAR(255),
emailuser				VARCHAR(255),
displayname				VARCHAR(255),
timezone				VARCHAR(255),
audiovideosettings		INT,
maxmikes				INT,
INDEX (idConference)
)";
				
				if(!$this->db_man->query($content)) return $this->_getErrArray($start_version, ++$i);
				
				$this->end_version = '3.5.0.4';
				return true;
			break;
		}
		return true;
	}
}

?>