+}
+?>
+done
+--- eventum-r3576/misc/upgrade/v2.1.1_to_v2.2/database_changes.php~ 2008-05-26 19:47:31.000000000 +0300
++++ eventum-r3576/misc/upgrade/v2.1.1_to_v2.2/database_changes.php 2008-05-26 19:48:28.734422670 +0300
+@@ -17,13 +17,6 @@
+ $stmts[] = "ALTER TABLE eventum_note CHANGE COLUMN not_blocked_message not_full_message longblob NOT NULL";
+ $stmts[] = "ALTER TABLE eventum_note ADD COLUMN not_is_blocked tinyint(1) NOT NULL DEFAULT 0";
+ $stmts[] = "UPDATE eventum_note SET not_is_blocked = 1 WHERE not_full_message != ''";
+-$stmts[] = "ALTER TABLE eventum_issue CHANGE COLUMN iss_res_id iss_res_id int(10) unsigned NULL DEFAULT NULL";
+-$stmts[] = "CREATE TABLE eventum_user_alias (
+- ual_usr_id int(11) unsigned not null,
+- ual_email varchar(255),
+- PRIMARY KEY(ual_usr_id, ual_email),
+- UNIQUE(ual_email)
+-)";
+
+ foreach ($stmts as $stmt) {
+ $stmt = str_replace('eventum_', APP_TABLE_PREFIX, $stmt);
+--- /dev/null 2006-03-28 14:00:37.000000000 +0300
++++ eventum-r3576/misc/upgrade/v2.1.1_to_v2.2/database_changes2.php 2008-05-26 19:48:54.139888911 +0300
+@@ -0,0 +1,31 @@
++<?php
++// avoid setup redirecting us
++define('CONFIG_PATH', '/etc/webapps/eventum');
++
++if (!file_exists(CONFIG_PATH. '/config.php')) {
++ die("Can't find config.php from ". CONFIG_PATH . ". Did you forgot to copy config from old install?");
++}
++
++require_once '/usr/share/eventum/htdocs/init.php';
++require_once APP_INC_PATH . 'db_access.php';
++
++$stmts = array();
++
++$stmts[] = "ALTER TABLE eventum_issue CHANGE COLUMN iss_res_id iss_res_id int(10) unsigned NULL DEFAULT NULL";
++$stmts[] = "CREATE TABLE eventum_user_alias (
++ ual_usr_id int(11) unsigned not null,
++ ual_email varchar(255),
++ PRIMARY KEY(ual_usr_id, ual_email),
++ UNIQUE(ual_email)
++)";
++
++foreach ($stmts as $stmt) {
++ $stmt = str_replace('eventum_', APP_TABLE_PREFIX, $stmt);
++ $res = $GLOBALS["db_api"]->dbh->query($stmt);
++ if (PEAR::isError($res)) {
++ echo "<pre>";var_dump($res);echo "</pre>";
++ exit(1);
++ }
++}
++?>
++done