<?xml version="1.0" ?>
<!DOCTYPE comupgrade>
<comupgrade version="1.0">
	<upgrade>
		<version version="1.0.0" versiondate="2007-04-15" build="100" versionname="">
			<query mode="silenterror">ALTER TABLE `#__kunena_attachments` ADD KEY `mesid`(`mesid`)</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` ADD PRIMARY KEY(`id`)</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` ADD KEY `parent`(`parent`)</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` ADD KEY `published_pubaccess_id`(`published`,`pub_access`,`id`)</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` DROP KEY `catid` </query>
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` DROP KEY `catparent`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_messages` ADD KEY `hold_time`(`hold`,`time`)</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_messages` ADD KEY `locked`(`locked`)</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_messages` ADD KEY `time`(`time`)</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_messages` DROP KEY `id`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_messages_text` DROP KEY `mesid`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_messages_text` ADD PRIMARY KEY(`mesid`)</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_moderation` DROP KEY `catid`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `group_id` int(4) NULL DEFAULT '1' AFTER `karma_time`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `uhits` int(11) NULL  DEFAULT '0' AFTER `group_id`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD KEY `group_id`(`group_id`)</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_whoisonline` ADD KEY `userid`(`userid`)</query>
			
			<query mode="silenterror">UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "&lt;br>&lt;br>", "\n\n")</query>
			<query mode="silenterror">INSERT INTO `#__kunena_groups` VALUES ('1', 'Registered User')</query>
		</version>
		<version version="1.0.1" versiondate="2007-05-20" build="101" versionname="">
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` MODIFY `moderated` tinyint(4) NOT NULL default '1' AFTER `alert_admin`;</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` ADD COLUMN `id_last_msg` int(10) NOT NULL DEFAULT '0' AFTER `description`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` ADD COLUMN `numTopics` mediumint(8) NOT NULL DEFAULT '0' AFTER `id_last_msg`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` ADD COLUMN `numPosts` mediumint(8) NOT NULL DEFAULT '0' AFTER `numTopics`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` ADD COLUMN `time_last_msg` int(11) NULL AFTER `numPosts`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` ADD KEY `msg_id`(`id_last_msg`)</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_messages` ADD COLUMN `modified_by` int(7) NULL AFTER `moved`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_messages` ADD COLUMN `modified_time` int(11) NULL AFTER `modified_by`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_messages` ADD COLUMN `modified_reason` tinytext NULL AFTER `modified_time`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `personalText` tinytext NULL AFTER `uhits`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `gender` tinyint(4) NOT NULL DEFAULT '0' AFTER `personalText`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `birthdate` date NOT NULL DEFAULT '0001-01-01' AFTER `gender`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `location` varchar(50) NULL AFTER `birthdate`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `ICQ` varchar(50) NULL AFTER `location`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `AIM` varchar(50) NULL AFTER `ICQ`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `YIM` varchar(50) NULL AFTER `AIM`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `MSN` varchar(50) NULL AFTER `YIM`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `SKYPE` varchar(50) NULL AFTER `MSN`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `hideEmail` tinyint(1) NOT NULL DEFAULT '1' AFTER `SKYPE`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `showOnline` tinyint(1) NOT NULL DEFAULT '1' AFTER `hideEmail`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `rank` tinyint(4) NOT NULL DEFAULT '0' AFTER `showOnline`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `GTALK` varchar(50) NULL AFTER `rank`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `websitename` varchar(50) NULL AFTER `GTALK`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD COLUMN `websiteurl` varchar(50) NULL AFTER `websitename`</query>

			<query>UPDATE `#__kunena_categories` SET `moderated` = '1';</query>
		</version>
		<version version="1.0.2" versiondate="2007-08-03" build="102" versionname="">
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` ADD COLUMN `headerdesc` text NOT NULL AFTER `description`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` ADD COLUMN `class_sfx` varchar(20) NOT NULL AFTER `headerdesc`</query>
		</version>
		<version version="1.0.3" versiondate="2007-09-04" build="103" versionname="">
			<query mode="silenterror">ALTER TABLE `#__kunena_sessions` ADD COLUMN `currvisit` int(11) NOT NULL default '0' AFTER `readtopics`</query>
		</version>
		<version version="1.0.4" versiondate="2007-12-23" build="104" versionname="">
			<query mode="silenterror">ALTER TABLE `#__kunena_announcement` MODIFY `title` tinytext NOT NULL AFTER `id`;</query>
		</version>
		<version version="1.0.5" versiondate="2008-12-1" build="855" versionname="Redwood">
		    <query>UPDATE `#__kunena_sessions` SET `allowed`='na'</query>
			<query>UPDATE `#__kunena_users` SET `rank`=8 WHERE `moderator`=1 AND `rank`=0</query>
			<query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "&amp;amp;#039;", "'")</query>
            <query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "&amp;amp;quot;", '"')</query>
            <query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "&amp;amp;nbsp;", " ")</query>
            <query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "&amp;lt;br />", "\n")</query>
            <query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "&amp;lt;br>", "\n")</query>
            <query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "&amp;amp;lt;", "&lt;")</query>
            <query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "&amp;amp;gt;", "&gt;")</query>
            <query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "&amp;amp;amp;", "&amp;")</query>
            <query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "[IMG", "[img")</query>
            <query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "[/IMG]", "[/img]")</query>
            <query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "[URL", "[url")</query>
            <query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "[/URL]", "[/url]")</query>
            <query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "[QUOTE", "[quote")</query>
            <query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "[/QUOTE]", "[/quote]")</query>
            <query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "[CODE", "[code")</query>
            <query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "[/CODE", "[/code")</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "&amp;amp;#039;", "'")</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "&amp;amp;quot;", '"')</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "&amp;amp;nbsp;", " ")</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "&amp;lt;br />", "\n")</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "&amp;lt;br>", "\n")</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "&amp;amp;lt;", "&lt;")</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "&amp;amp;gt;", "&gt;")</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "&amp;amp;amp;", "&amp;")</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "[IMG", "[img")</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "[/IMG]", "[/img]")</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "[URL", "[url")</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "[/URL]", "[/url]")</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "[QUOTE", "[quote")</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "[/QUOTE]", "[/quote]")</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "[CODE", "[code")</query>
            <query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "[/CODE", "[/code")</query>
		</version>
		<version version="1.0.6" versiondate="2009-01-10" build="870" versionname="Communicate">
			<query mode="silenterror">ALTER TABLE `#__kunena_messages` ADD KEY `parent_hits`(`parent`,`hits`)</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD KEY `posts` ( `posts` )</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD KEY `uhits` ( `uhits` )</query>
		</version>
		<version version="1.0.8" versiondate="2009-02-17" build="1166" versionname="Speakup!">
			<phpfile name="upgrade-1.0.8_favorites" />
			<!-- query mode="silenterror">ALTER TABLE `#__kunena_config` CHANGE `annmodid` `annmodid` TEXT NULL DEFAULT NULL</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_config` CHANGE `latestcategory` `latestcategory` TEXT NULL DEFAULT NULL</query>
			<query mode="silenterror">UPDATE `#__kunena_config` SET `latestcategory`=''</query -->
			<query>UPDATE `#__kunena_users` SET `view`='flat'</query>
			<query>UPDATE `#__kunena_messages_text` SET `message` = REPLACE(`message`, "com_fireboard", "com_kunena")</query>
			<query>UPDATE `#__kunena_users` SET `signature` = REPLACE(`signature`, "com_fireboard", "com_kunena")</query>
		</version>
		<version version="1.0.10" versiondate="2009-05-21" build="1344" versionname="Parier!">
			<!-- query mode="silenterror">UPDATE `#__kunena_config` SET `jmambot`='0'</query -->
		</version>
		<version version="1.6.0-ALPHA" versiondate="2010-05-30" build="2587" versionname="Gespraech">
			<query mode="silenterror">ALTER TABLE `#__kunena_users` 
				ADD `TWITTER` VARCHAR( 50 ) NULL AFTER `SKYPE` ,
				ADD `FACEBOOK` VARCHAR( 50 ) NULL AFTER `TWITTER` ,
				ADD `MYSPACE` VARCHAR( 50 ) NULL AFTER `GTALK` ,
				ADD `LINKEDIN` VARCHAR( 50 )  NULL AFTER `MYSPACE` ,
				ADD `DELICIOUS` VARCHAR( 50 )  NULL AFTER `LINKEDIN` ,
				ADD `FRIENDFEED` VARCHAR( 50 )  NULL AFTER `DELICIOUS` ,
				ADD `DIGG` VARCHAR( 50 )  NULL AFTER `FRIENDFEED` ,
				ADD `BLOGSPOT` VARCHAR( 50 )  NULL AFTER `DIGG` ,
				ADD `FLICKR` VARCHAR( 50 )  NULL AFTER `BLOGSPOT` ,
				ADD `BEBO` VARCHAR( 50 )  NULL AFTER `FLICKR` ;</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` 
				ADD `allow_polls` tinyint(4) NOT NULL default '0' AFTER `class_sfx` ;</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` ADD `allow_anonymous` TINYINT NOT NULL DEFAULT '0' AFTER `review` ,
				ADD `post_anonymous` TINYINT NOT NULL DEFAULT '0' AFTER `allow_anonymous` </query>
			<query mode="silenterror">ALTER TABLE `#__kunena_sessions` ADD KEY `currvisit` ( `currvisit` )</query>
			<query>UPDATE `#__kunena_messages` SET thread=id WHERE parent=0</query>
			<query mode="silenterror">UPDATE `#__kunena_users` AS u, `#__users` AS j SET u.moderator='0' WHERE j.id=u.userid AND j.gid IN (24, 25)</query>
			<phpfile name="upgrade-1.6.0_attachments"></phpfile>
			<phpfile name="upgrade-1.6.0_configuration"></phpfile>
			<phpfile name="upgrade-1.6.0_polls"></phpfile>
			<phpfile name="upgrade-1.6.0_timezone"></phpfile>
		</version>
		<version version="1.6.0-ALPHA2" versiondate="2010-06-21" build="2806" versionname="Gespraech">
			<query mode="silenterror">DROP TABLE IF EXISTS `#__kunena_banned_users`</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_users` 
				ADD `banned` DATETIME NULL DEFAULT NULL AFTER `moderator`</query>
			<phpfile name="upgrade-1.6.0_old_mt12"></phpfile>
		</version>
		<version version="1.6.0-RC1" versiondate="2010-08-09" build="3173" versionname="Kujadili">
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD KEY `banned` ( `banned` )</query>
			<query>ALTER TABLE `#__kunena_polls` MODIFY `polltimetolive` DATETIME NULL DEFAULT NULL;</query>
			<query>ALTER TABLE `#__kunena_polls_options` MODIFY `text` varchar(100) NULL;</query>
			<query>ALTER TABLE `#__kunena_thankyou` MODIFY `time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;</query>
			<query>ALTER TABLE `#__kunena_users_banned` MODIFY `expiration` DATETIME NULL;</query>
			<query>ALTER TABLE `#__kunena_users_banned` MODIFY `created_time` DATETIME NOT NULL;</query>
			<query>ALTER TABLE `#__kunena_users_banned` MODIFY `modified_time` DATETIME NULL;</query>
		</version>
		<version version="1.6.0-RC3" versiondate="2010-09-20" build="3539" versionname="Jadili">
			<query mode="silenterror">ALTER TABLE `#__kunena_messages` DROP INDEX `catid`;</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_messages` DROP INDEX `parent`;</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_messages` ADD INDEX `catid_parent` ( `catid`, `parent` );</query>
		</version>
		<version version="1.6.0" versiondate="2010-10-03" build="3620" versionname="Spika">
		</version>
		<version version="1.6.1" versiondate="2010-11-06" build="3858" versionname="Timu">
			<phpfile name="upgrade-1.6.1_delfiles"></phpfile>
		</version>
		<version version="1.6.2" versiondate="2010-12-29" build="3894" versionname="Team">
		</version>
		<version version="1.6.3" versiondate="2011-01-31" build="4344" versionname="Parlare">
			<query mode="silenterror">
				ALTER TABLE `#__kunena_categories` 
					ADD `accesstype` varchar(20) NOT NULL default 'none' AFTER `moderators`,
					ADD `access` int(11) NOT NULL default '0' AFTER `accesstype`,
					ADD KEY `category_access` (accesstype,access);
			</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_whoisonline` DROP INDEX `userip`;</query>
			<query mode="silenterror">
				ALTER TABLE `#__kunena_whoisonline` 
					MODIFY `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
					MODIFY `userid` INT( 11 ) NOT NULL DEFAULT '0',
					ADD INDEX `userid_userip` ( `userid` , `userip` ),
					ADD INDEX `func` ( `func` ),
					ADD INDEX `time` ( `time` );
			</query>
		</version>
		<version version="1.6.4" versiondate="2011-05-07" build="4832" versionname="Kerkrade">
			<query mode="silenterror">ALTER TABLE `#__kunena_users` ADD INDEX `moderator` ( `moderator` );</query>
			<query mode="silenterror">ALTER TABLE `#__kunena_categories` MODIFY `ordering` smallint(6) NOT NULL default '0' AFTER `admin_recurse`;</query>
			
		</version>
	</upgrade>
</comupgrade>