<?
include("init.php");
$versionToUp = "2.0.7";
if(isset($_POST['go'])){
	Serval::call('db')->run("ALTER TABLE  `mod_scan` CHANGE  `data_process`  `data_process` LONGTEXT NOT NULL;");
	Serval::call('db')->run("ALTER TABLE  `mod_projects` ADD  `excf` VARCHAR( 255 ) NOT NULL AFTER  `exc` ;");
	Serval::call('db')->run("ALTER TABLE  `mod_projects` ADD  `is_active` ENUM(  'yes',  'no' ) NOT NULL DEFAULT  'yes' AFTER  `error_msg` , ADD INDEX (  `is_active` ) ;");
	Serval::call('db')->run("ALTER TABLE  `mod_projects` ADD  `attempt_check` int(1) NOT NULL DEFAULT '0' AFTER  `last_date_check`;");
	Serval::call('db')->run("ALTER TABLE  `mod_projects` CHANGE  `crypt_type`  `crypt_type` ENUM(  'default',  'lite',  'reinforced' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'lite';");
	Serval::call('db')->run("ALTER TABLE  `mod_projects` ADD  `last_date_process` DATETIME NOT NULL AFTER  `last_date_check` ;");
	Serval::call('db')->run("UPDATE mod_projects SET last_date_process=last_date_check");
	Serval::call('db')->run("ALTER TABLE  `mod_projects` ADD  `is_change_email` ENUM(  'yes',  'no' ) NOT NULL DEFAULT  'no' AFTER  `is_active`;");
	Serval::call('db')->run("ALTER TABLE  `mod_projects` ADD  `maxtime` int(15) NOT NULL DEFAULT '0' AFTER  `is_change_email`;");
	
	echo "OK to Up v.{$versionToUp}";
	unlink("update.php");
	if( file_exists("install.php") ){
		unlink("install.php");
	}
	die();
}       
?>
<form method="post">
	<input type="submit" name="go" value="Go to up v.<?=$versionToUp?>">
</form>