Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/setup/upgrade/0.9.9
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2020-02-01 09:05:48 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2020-02-01 09:05:48 +0100
commit6854cb3f4d8219cf1829e32122eb2502a916eae9 (patch)
tree350feb504587d932e02837a1442b059759927646 /setup/upgrade/0.9.9
initial checkin
Diffstat (limited to 'setup/upgrade/0.9.9')
-rw-r--r--setup/upgrade/0.9.9/add_data.php34
-rw-r--r--setup/upgrade/0.9.9/add_duplicates.php41
-rw-r--r--setup/upgrade/0.9.9/add_searches.php22
-rw-r--r--setup/upgrade/0.9.9/clean_unique.php67
-rw-r--r--setup/upgrade/0.9.9/convert_categories.php43
-rw-r--r--setup/upgrade/0.9.9/convert_private.php26
-rw-r--r--setup/upgrade/0.9.9/flyspray-begin.xml748
-rw-r--r--setup/upgrade/0.9.9/flyspray-final.xml976
-rw-r--r--setup/upgrade/0.9.9/flyspray-install.xml1044
-rw-r--r--setup/upgrade/0.9.9/rename_columns.php14
-rw-r--r--setup/upgrade/0.9.9/upgrade.info44
-rw-r--r--setup/upgrade/0.9.9/upgrade_assignments.php31
12 files changed, 3090 insertions, 0 deletions
diff --git a/setup/upgrade/0.9.9/add_data.php b/setup/upgrade/0.9.9/add_data.php
new file mode 100644
index 0000000..8c32d38
--- /dev/null
+++ b/setup/upgrade/0.9.9/add_data.php
@@ -0,0 +1,34 @@
+<?php
+ /**********************************************************\
+ | This script adds/deletes data what can't be added to |
+ | the XML schema files. |
+ \***********************************************************/
+
+// New status list, make sure data is only inserted if we have an empty table
+$sql = $db->query('SELECT count(*) FROM {list_status}');
+if ($db->fetchOne($sql) < 1) {
+ $db->query("INSERT INTO {list_status} (status_name, list_position, show_in_list, project_id) VALUES ('Unconfirmed', 1, 1, 0)");
+ $db->query("INSERT INTO {list_status} (status_name, list_position, show_in_list, project_id) VALUES ('New', 2, 1, 0)");
+ $db->query("INSERT INTO {list_status} (status_name, list_position, show_in_list, project_id) VALUES ('Assigned', 3, 1, 0)");
+ $db->query("INSERT INTO {list_status} (status_name, list_position, show_in_list, project_id) VALUES ('Researching', 4, 1, 0)");
+ $db->query("INSERT INTO {list_status} (status_name, list_position, show_in_list, project_id) VALUES ('Waiting on Customer', 5, 1, 0)");
+ $db->query("INSERT INTO {list_status} (status_name, list_position, show_in_list, project_id) VALUES ('Requires testing', 6, 1, 0)");
+}
+
+if (Post::val('replace_resolution')) {
+ $db->query('UPDATE {list_resolution} SET resolution_name = ? WHERE resolution_id = ?', array('Duplicate (the real one)', 6));
+}
+
+$db->query("DELETE FROM {list_status} WHERE status_id = 7");
+$db->query("DELETE FROM {notifications} WHERE user_id = 0 OR task_id = 0");
+
+$db->query("UPDATE {tasks} SET closure_comment='' WHERE closure_comment='0'");
+$db->query("UPDATE {groups} SET add_to_assignees = '1' WHERE assign_others_to_self =1 ");
+$db->query("UPDATE {groups} SET add_votes = 1 WHERE group_id = 2 OR group_id = 3 OR group_id = 6");
+$db->query("UPDATE {groups} SET edit_assignments = '1' WHERE group_id = 2");
+$db->query("UPDATE {history} SET event_type = 3 WHERE event_type = 0");
+$db->query("UPDATE {history} SET event_type = 11 WHERE event_type = 15");
+$db->query("UPDATE {history} SET event_type = 12 WHERE event_type = 16");
+$db->query("UPDATE {history} SET field_changed = 'project_id' WHERE field_changed = 'attached_to_project'");
+
+?>
diff --git a/setup/upgrade/0.9.9/add_duplicates.php b/setup/upgrade/0.9.9/add_duplicates.php
new file mode 100644
index 0000000..4a00a8a
--- /dev/null
+++ b/setup/upgrade/0.9.9/add_duplicates.php
@@ -0,0 +1,41 @@
+<?php
+ /**********************************************************\
+ | This script enters the relations of duplicate tasks into |
+ | the databse. |
+ \***********************************************************/
+
+
+$check_sql = $db->query('SELECT task_id, closure_comment, resolution_reason FROM {tasks}');
+
+while ($row = $db->fetchRow($check_sql))
+{
+ if ($row['resolution_reason'] == 6) {
+ preg_match("/\b(?:FS#|bug )(\d+)\b/", $row['closure_comment'], $dupe_of);
+ if (count($dupe_of)) {
+ $existing = $db->query('SELECT * FROM {related} WHERE this_task = ? AND related_task = ? AND is_duplicate = 1',
+ array($row['task_id'], $dupe_of[1]));
+
+ if ($db->countRows($existing) == 0) {
+ $db->query('INSERT INTO {related} (this_task, related_task, is_duplicate) VALUES(?,?,1)',
+ array($row['task_id'], $dupe_of[1]));
+ echo $row['task_id'] . ' is a duplicate of ' . $dupe_of[1] . '.<br />';
+ }
+ }
+ }
+}
+
+$check_sql = $db->query('SELECT this_task, related_task FROM {related} WHERE is_duplicate = 0');
+$deleted = array();
+
+while ($row = $db->fetchRow($check_sql))
+{
+ $existing = $db->query('SELECT related_id FROM {related} WHERE this_task = ? AND related_task = ? AND is_duplicate = 0',
+ array($row['related_task'], $row['this_task']));
+
+ if ($db->countRows($existing) == 1 && !isset($deleted[$row['related_task'].'-'.$row['this_task']])) {
+ $deleted[$row['this_task'].'-'.$row['related_task']] = true;
+ $db->query('DELETE FROM {related} WHERE related_id = ?', array($db->fetchOne($existing)));
+ }
+}
+
+?>
diff --git a/setup/upgrade/0.9.9/add_searches.php b/setup/upgrade/0.9.9/add_searches.php
new file mode 100644
index 0000000..6e5031c
--- /dev/null
+++ b/setup/upgrade/0.9.9/add_searches.php
@@ -0,0 +1,22 @@
+<?php
+ /**********************************************************\
+ | This script addes some default saved searches for every |
+ | user. |
+ \***********************************************************/
+
+$check_sql = $db->query('SELECT user_id FROM {users}');
+
+while ($row = $db->fetchRow($check_sql))
+{
+ $db->query('DELETE FROM {searches} WHERE (name = ? OR name = ? OR name = ?) AND user_id = ?', array('Tasks I watch', 'Tasks assigned to me', 'Tasks I opened', $row['user_id']));
+ $db->query('INSERT INTO {searches} (user_id, name, search_string, time) VALUES (?, \'Tasks I watch\', \'a:16:{s:6:"string";N;s:4:"type";a:1:{i:0;s:0:"";}s:3:"sev";a:1:{i:0;s:0:"";}s:3:"due";a:1:{i:0;s:0:"";}s:3:"dev";N;s:3:"cat";a:1:{i:0;s:0:"";}s:6:"status";a:1:{i:0;s:4:"open";}s:5:"order";N;s:4:"sort";N;s:7:"percent";a:1:{i:0;s:0:"";}s:6:"opened";N;s:18:"search_in_comments";N;s:14:"search_for_all";N;s:8:"reported";a:1:{i:0;s:0:"";}s:12:"only_primary";N;s:12:"only_watched";s:1:"1";}\', ' . time() . ')',
+ array($row['user_id']));
+ $db->query('INSERT INTO {searches} (user_id, name, search_string, time) VALUES (?, \'Tasks assigned to me\', \'a:16:{s:6:"string";N;s:4:"type";a:1:{i:0;s:0:"";}s:3:"sev";a:1:{i:0;s:0:"";}s:3:"due";a:1:{i:0;s:0:"";}s:3:"dev";s:' . strlen($row['user_id']) . ':"' . $row['user_id'] .'";s:3:"cat";a:1:{i:0;s:0:"";}s:6:"status";a:1:{i:0;s:4:"open";}s:5:"order";N;s:4:"sort";N;s:7:"percent";a:1:{i:0;s:0:"";}s:6:"opened";N;s:18:"search_in_comments";N;s:14:"search_for_all";N;s:8:"reported";a:1:{i:0;s:0:"";}s:12:"only_primary";N;s:12:"only_watched";N;}\', ' . time() . ')',
+ array($row['user_id']));
+ $db->query('INSERT INTO {searches} (user_id, name, search_string, time) VALUES (?, \'Tasks I opened\', \'a:16:{s:6:"string";N;s:4:"type";a:1:{i:0;s:0:"";}s:3:"sev";a:1:{i:0;s:0:"";}s:3:"due";a:1:{i:0;s:0:"";}s:3:"dev";N;s:3:"cat";a:1:{i:0;s:0:"";}s:6:"status";a:1:{i:0;s:4:"open";}s:5:"order";N;s:4:"sort";N;s:7:"percent";a:1:{i:0;s:0:"";}s:6:"opened";s:' . strlen($row['user_id']) . ':"' . $row['user_id'] .'";s:18:"search_in_comments";N;s:14:"search_for_all";N;s:8:"reported";a:1:{i:0;s:0:"";}s:12:"only_primary";N;s:12:"only_watched";N;}\', ' . time() . ')',
+ array($row['user_id']));
+}
+
+
+?>
+
diff --git a/setup/upgrade/0.9.9/clean_unique.php b/setup/upgrade/0.9.9/clean_unique.php
new file mode 100644
index 0000000..652630b
--- /dev/null
+++ b/setup/upgrade/0.9.9/clean_unique.php
@@ -0,0 +1,67 @@
+<?php
+ /**********************************************************\
+ | This script removes duplicate db entries |
+ \**********************************************************/
+
+// Users
+
+$users = $db->query('SELECT * FROM {users} ORDER BY user_id ASC');
+
+while ($row = $db->fetchRow($users))
+{
+ if (!isset($deleted[$row['user_name']])) {
+ $deleted[$row['user_name']] = $row['user_id'];
+ }
+
+ $db->query('DELETE FROM {users} WHERE user_name = ? AND user_id != ?',
+ array($row['user_name'], $deleted[$row['user_name']]));
+}
+
+
+$users = $db->query('SELECT * FROM {registrations} ORDER BY reg_id ASC');
+
+while ($row = $db->fetchRow($users))
+{
+ if (!isset($deleted[$row['user_name']])) {
+ $deleted[$row['user_name']] = $row['reg_id'];
+ }
+
+ $db->query('DELETE FROM {registrations} WHERE user_name = ? AND reg_id != ?',
+ array($row['user_name'], $deleted[$row['user_name']]));
+}
+
+// Users in groups
+
+$sql = $db->query('SELECT * FROM {users_in_groups} ORDER BY record_id');
+while ($row = $db->fetchRow($sql))
+{
+ $db->query('DELETE FROM {users_in_groups} WHERE user_id = ? AND group_id = ? AND record_id <> ?',
+ array($row['user_id'], $row['group_id'], $row['record_id']));
+}
+
+// Group names
+
+$sql = $db->query('SELECT * FROM {groups} ORDER BY group_id ASC');
+while ($row = $db->fetchRow($sql))
+{
+ $col = 'belongs_to_project';
+ if (!isset($row[$col])) {
+ $col = 'project_id';
+ }
+
+ $db->query('DELETE FROM {groups} WHERE group_name = ? AND '.$col.' = ? AND group_id <> ?',
+ array($row['group_name'], $row[$col], $row['group_id']));
+}
+
+// Out of range value adjusted for column..
+$sql = $db->query('SELECT * FROM {tasks}');
+while ($row = $db->fetchRow($sql))
+{
+ $db->query('UPDATE {tasks} SET date_closed = ?, last_edited_time = ? WHERE task_id = ?',
+ array(intval($row['date_closed']), intval($row['last_edited_time']), $row['task_id']));
+ if (isset($row['due_date'])) {
+ $db->query('UPDATE {tasks} SET due_date = ? WHERE task_id = ?',
+ array(intval($row['due_date']), $row['task_id']));
+ }
+}
+?>
diff --git a/setup/upgrade/0.9.9/convert_categories.php b/setup/upgrade/0.9.9/convert_categories.php
new file mode 100644
index 0000000..99789ad
--- /dev/null
+++ b/setup/upgrade/0.9.9/convert_categories.php
@@ -0,0 +1,43 @@
+<?php
+ /**********************************************************\
+ | This script converts the categories table to the new |
+ | format. |
+ \***********************************************************/
+
+function rebuild_tree($parent, $left, $pr) {
+ global $db;
+ // the right value of this node is the left value + 1
+ $right = $left+1;
+
+ // get all children of this node
+ $result = $db->query('SELECT category_id FROM {list_category} WHERE parent_id = ? AND project_id = ?', array($parent, $pr));
+
+ while ($row = $db->fetchRow($result)) {
+ // recursive execution of this function for each
+ // child of this node
+ // $right is the current right value, which is
+ // incremented by the rebuild_tree function
+ $right = rebuild_tree($row['category_id'], $right, $pr);
+ }
+
+ // we've got the left value, and now that we've processed
+ // the children of this node we also know the right value
+ $db->query('UPDATE {list_category} SET lft= ?, rgt= ? WHERE category_id = ?', array($left, $right, $parent));
+ $sql = $db->query('SELECT * FROM {list_category} WHERE category_id = ? OR project_id=? AND parent_id=-1', array($parent, $pr));
+ if (!$db->countRows($sql)) {
+ $db->query('INSERT INTO {list_category} (project_id, lft, rgt, category_name, parent_id) VALUES(?,?,?,?,-1)',
+ array($pr,$left,$right,'root'));
+ }
+ // return the right value of this node + 1
+ return $right+1;
+}
+
+$projects = $db->query('SELECT project_id FROM {projects}');
+
+// Global project
+rebuild_tree(0, 1, 0);
+while ($pr = $db->fetchRow($projects)) {
+ rebuild_tree(0, 1, $pr['project_id']);
+}
+
+?>
diff --git a/setup/upgrade/0.9.9/convert_private.php b/setup/upgrade/0.9.9/convert_private.php
new file mode 100644
index 0000000..b871d39
--- /dev/null
+++ b/setup/upgrade/0.9.9/convert_private.php
@@ -0,0 +1,26 @@
+<?php
+ /**********************************************************\
+ | This script converts the private/public history entries |
+ \***********************************************************/
+
+
+$check_sql = $db->query('SELECT * FROM {history} WHERE event_type = 26 OR event_type = 27');
+
+while ($row = $db->fetchRow($check_sql))
+{
+ $db->query('DELETE FROM {history} WHERE history_id = ?', array($row['history_id']));
+ if ($row['event_type'] == 26) {
+ $row['old_value'] = 0;
+ $row['new_value'] = 1;
+ }
+ if ($row['event_type'] == 27) {
+ $row['old_value'] = 1;
+ $row['new_value'] = 0;
+ }
+ $db->query("INSERT INTO {history} (task_id, user_id, event_date, event_type, field_changed, old_value, new_value)
+ VALUES(?, ?, ?, 0, 'mark_private', ?, ?)",
+ array($row['task_id'], $row['user_id'], $row['event_date'], $row['old_value'], $row['new_value']));
+}
+
+
+?>
diff --git a/setup/upgrade/0.9.9/flyspray-begin.xml b/setup/upgrade/0.9.9/flyspray-begin.xml
new file mode 100644
index 0000000..aac979a
--- /dev/null
+++ b/setup/upgrade/0.9.9/flyspray-begin.xml
@@ -0,0 +1,748 @@
+<?xml version="1.0"?>
+<schema version="0.3">
+ <table name="admin_requests">
+ <field name="request_id" type="I" size="5">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_id" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="task_id" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="submitted_by" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="request_type" type="I" size="2">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="reason_given" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="time_submitted" type="C" size="12">
+ <NOTNULL/>
+ </field>
+ <field name="resolved_by" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="time_resolved" type="C" size="12">
+ <NOTNULL/>
+ </field>
+ <field name="deny_reason" type="C" size="255">
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="assigned">
+ <field name="assigned_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="user_or_group" type="C" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="user_id" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="attachments">
+ <field name="attachment_id" type="I" size="5">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="comment_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="orig_name" type="C" size="255">
+ <NOTNULL/>
+ </field>
+ <field name="file_name" type="C" size="30">
+ <NOTNULL/>
+ </field>
+ <field name="file_type" type="C" size="50">
+ <NOTNULL/>
+ </field>
+ <field name="file_size" type="I" size="20">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="added_by" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="date_added" type="C" size="12">
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="comments">
+ <field name="comment_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="date_added" type="C" size="12">
+ <NOTNULL/>
+ </field>
+ <field name="user_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="comment_text" type="X">
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="dependencies">
+ <field name="depend_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="dep_task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="groups">
+ <field name="group_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="group_name" type="C" size="20">
+ <NOTNULL/>
+ </field>
+ <field name="group_desc" type="C" size="150">
+ <NOTNULL/>
+ </field>
+ <field name="belongs_to_project" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="is_admin" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="manage_project" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="view_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="open_new_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="modify_own_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="modify_all_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="view_comments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="add_comments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="edit_comments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="delete_comments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="view_attachments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="create_attachments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="delete_attachments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="view_history" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="close_own_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="close_other_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="assign_to_self" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="assign_others_to_self" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="view_reports" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="group_open" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="history">
+ <field name="history_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="user_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="event_date" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="event_type" type="I" size="2">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="field_changed" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="old_value" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="new_value" type="X">
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="list_category">
+ <field name="category_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="category_name" type="C" size="40">
+ <NOTNULL/>
+ </field>
+ <field name="list_position" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="category_owner" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="supertask_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="lft" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ <UNSIGNED/>
+ </field>
+ <field name="rgt" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ <UNSIGNED/>
+ </field>
+ </table>
+ <table name="list_os">
+ <field name="os_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="os_name" type="C" size="40">
+ <NOTNULL/>
+ </field>
+ <field name="list_position" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="list_resolution">
+ <field name="resolution_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="resolution_name" type="C" size="40">
+ <NOTNULL/>
+ </field>
+ <field name="list_position" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="list_tasktype">
+ <field name="tasktype_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="tasktype_name" type="C" size="40">
+ <NOTNULL/>
+ </field>
+ <field name="list_position" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="list_version">
+ <field name="version_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="version_name" type="C" size="40">
+ <NOTNULL/>
+ </field>
+ <field name="list_position" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="version_tense" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="notification_messages">
+ <field name="message_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="message_subject" type="C" size="50">
+ <NOTNULL/>
+ </field>
+ <field name="message_body" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="time_created" type="C" size="20"/>
+ </table>
+ <table name="notification_recipients">
+ <field name="recipient_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="message_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="notify_method" type="C" size="1">
+ <NOTNULL/>
+ </field>
+ <field name="notify_address" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="notifications">
+ <field name="notify_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="user_id" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="prefs">
+ <field name="pref_id" type="I" size="1">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="pref_name" type="C" size="30">
+ <NOTNULL/>
+ </field>
+ <field name="pref_value" type="C" size="250">
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="projects">
+ <field name="project_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_title" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="theme_style" type="C" size="20">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_logo" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="inline_images" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="default_cat_owner" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="intro_message" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="project_is_active" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="visible_columns" type="C" size="255">
+ <NOTNULL/>
+ </field>
+ <field name="others_view" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="anon_open" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="notify_email" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="notify_email_when" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="notify_jabber" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="notify_jabber_when" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="registrations">
+ <field name="reg_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="reg_time" type="C" size="12">
+ <NOTNULL/>
+ </field>
+ <field name="confirm_code" type="C" size="20">
+ <NOTNULL/>
+ </field>
+ <field name="user_name" type="C" size="20">
+ <NOTNULL/>
+ </field>
+ <field name="real_name" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="email_address" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="jabber_id" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="notify_type" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="magic_url" type="C" size="40">
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="related">
+ <field name="related_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="this_task" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="related_task" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="is_duplicate" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="reminders">
+ <field name="reminder_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="to_user_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="from_user_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="start_time" type="C" size="12">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="how_often" type="I" size="12">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="last_sent" type="C" size="12">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="reminder_message" type="X">
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="searches">
+ <field name="id" type="I" size="11">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="user_id" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="name" type="C" size="50">
+ <NOTNULL/>
+ </field>
+ <field name="search_string" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="time" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="tasks">
+ <field name="task_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="attached_to_project" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="task_type" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="date_opened" type="C" size="12">
+ <NOTNULL/>
+ </field>
+ <field name="opened_by" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="is_closed" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="date_closed" type="C" size="12">
+ <NOTNULL/>
+ </field>
+ <field name="closed_by" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="closure_comment" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="item_summary" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="detailed_desc" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="item_status" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="assigned_to" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="resolution_reason" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="1"/>
+ </field>
+ <field name="product_category" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="product_version" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="closedby_version" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="operating_system" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="task_severity" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="task_priority" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="last_edited_by" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="last_edited_time" type="C" size="12">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="percent_complete" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="mark_private" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="due_date" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="users">
+ <field name="user_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="user_name" type="C" size="20">
+ <NOTNULL/>
+ </field>
+ <field name="user_pass" type="C" size="40"/>
+ <field name="real_name" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="jabber_id" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="email_address" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="notify_type" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="account_enabled" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="dateformat" type="C" size="30">
+ <NOTNULL/>
+ </field>
+ <field name="dateformat_extended" type="C" size="30">
+ <NOTNULL/>
+ </field>
+ <field name="magic_url" type="C" size="40">
+ <NOTNULL/>
+ </field>
+ <field name="last_search" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="tasks_perpage" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="users_in_groups">
+ <field name="record_id" type="I" size="5">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="user_id" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="group_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+</schema>
diff --git a/setup/upgrade/0.9.9/flyspray-final.xml b/setup/upgrade/0.9.9/flyspray-final.xml
new file mode 100644
index 0000000..5db6a96
--- /dev/null
+++ b/setup/upgrade/0.9.9/flyspray-final.xml
@@ -0,0 +1,976 @@
+<?xml version="1.0"?>
+<schema version="0.3">
+ <table name="admin_requests">
+ <field name="request_id" type="I" size="5">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_id" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="task_id" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="submitted_by" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="request_type" type="I" size="2">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="reason_given" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="time_submitted" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="resolved_by" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="time_resolved" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="deny_reason" type="C" size="255">
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="assigned">
+ <field name="assigned_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="user_id" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="task_user">
+ <UNIQUE/>
+ <col>task_id</col>
+ <col>user_id</col>
+ </index>
+ <index name="task_id_assigned">
+ <col>task_id</col>
+ <col>user_id</col>
+ </index>
+ </table>
+ <table name="attachments">
+ <field name="attachment_id" type="I" size="5">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="comment_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="orig_name" type="C" size="255">
+ <NOTNULL/>
+ </field>
+ <field name="file_name" type="C" size="30">
+ <NOTNULL/>
+ </field>
+ <field name="file_type" type="C" size="50">
+ <NOTNULL/>
+ </field>
+ <field name="file_size" type="I" size="20">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="added_by" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="date_added" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="task_id_attachments">
+ <col>task_id</col>
+ <col>comment_id</col>
+ </index>
+ </table>
+ <table name="cache">
+ <field name="id" type="I" size="6">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="type" type="C" size="4">
+ <NOTNULL/>
+ </field>
+ <field name="content" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="topic" type="C" size="30">
+ <NOTNULL/>
+ </field>
+ <field name="last_updated" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="project_id" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="max_items" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="cache_type">
+ <UNIQUE/>
+ <col>type</col>
+ <col>topic</col>
+ <col>project_id</col>
+ <col>max_items</col>
+ </index>
+ </table>
+ <table name="comments">
+ <field name="comment_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="date_added" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="user_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="comment_text" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="last_edited_time" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="task_id_comments">
+ <col>task_id</col>
+ </index>
+ </table>
+ <table name="dependencies">
+ <field name="depend_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="dep_task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="task_id_deps">
+ <UNIQUE/>
+ <col>task_id</col>
+ <col>dep_task_id</col>
+ </index>
+ </table>
+ <table name="groups">
+ <field name="group_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="group_name" type="C" size="20">
+ <NOTNULL/>
+ </field>
+ <field name="group_desc" type="C" size="150">
+ <NOTNULL/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="is_admin" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="manage_project" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="view_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="open_new_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="modify_own_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="modify_all_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="view_comments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="add_comments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="edit_comments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="edit_own_comments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="delete_comments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="create_attachments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="delete_attachments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="view_history" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="close_own_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="close_other_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="assign_to_self" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="assign_others_to_self" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="add_to_assignees" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="view_reports" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="add_votes" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="edit_assignments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="group_open" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="group_name">
+ <UNIQUE/>
+ <col>group_name</col>
+ <col>project_id</col>
+ </index>
+ <index name="belongs_to_project">
+ <col>project_id</col>
+ </index>
+ </table>
+ <table name="history">
+ <field name="history_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="user_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="event_date" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="event_type" type="I" size="2">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="field_changed" type="C" size="50">
+ <NOTNULL/>
+ </field>
+ <field name="old_value" type="X" />
+ <field name="new_value" type="X" />
+ <index name="idx_task_id">
+ <col>task_id</col>
+ </index>
+ </table>
+ <table name="list_category">
+ <field name="category_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="category_name" type="C" size="40">
+ <NOTNULL/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="category_owner" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="lft" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ <UNSIGNED/>
+ </field>
+ <field name="rgt" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ <UNSIGNED/>
+ </field>
+ <index name="project_id_cat">
+ <col>project_id</col>
+ </index>
+ </table>
+ <table name="list_os">
+ <field name="os_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="os_name" type="C" size="40">
+ <NOTNULL/>
+ </field>
+ <field name="list_position" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="project_id_os">
+ <col>project_id</col>
+ </index>
+ </table>
+ <table name="list_resolution">
+ <field name="resolution_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="resolution_name" type="C" size="40">
+ <NOTNULL/>
+ </field>
+ <field name="list_position" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="project_id_res">
+ <col>project_id</col>
+ </index>
+ </table>
+ <table name="list_status">
+ <field name="status_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="status_name" type="C" size="40">
+ <NOTNULL/>
+ </field>
+ <field name="list_position" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="project_id_status">
+ <col>project_id</col>
+ </index>
+ </table>
+ <table name="list_tasktype">
+ <field name="tasktype_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="tasktype_name" type="C" size="40">
+ <NOTNULL/>
+ </field>
+ <field name="list_position" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="project_id_tt">
+ <col>project_id</col>
+ </index>
+ </table>
+ <table name="list_version">
+ <field name="version_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="version_name" type="C" size="40">
+ <NOTNULL/>
+ </field>
+ <field name="list_position" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="version_tense" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="project_id_version">
+ <col>project_id</col>
+ <col>version_tense</col>
+ </index>
+ </table>
+ <table name="notification_messages">
+ <field name="message_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="message_subject" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="message_body" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="time_created" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="notification_recipients">
+ <field name="recipient_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="message_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="notify_method" type="C" size="1">
+ <NOTNULL/>
+ </field>
+ <field name="notify_address" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="notifications">
+ <field name="notify_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="user_id" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="prefs">
+ <field name="pref_id" type="I" size="1">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="pref_name" type="C" size="30">
+ <NOTNULL/>
+ </field>
+ <field name="pref_value" type="C" size="250">
+ <DEFAULT value="0"/>
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="projects">
+ <field name="project_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_title" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="theme_style" type="C" size="20">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="default_cat_owner" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="intro_message" type="X">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="project_is_active" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="visible_columns" type="C" size="255">
+ <NOTNULL/>
+ </field>
+ <field name="others_view" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="anon_open" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="notify_email" type="X">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="notify_jabber" type="X">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="notify_reply" type="X">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="notify_types" type="C" size="100">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="feed_img_url" type="X">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="feed_description" type="X">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="notify_subject" type="C" size="100">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="lang_code" type="C" size="10">
+ <NOTNULL/>
+ <DEFAULT value="en"/>
+ </field>
+ <field name="comment_closed" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="auto_assign" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="last_updated" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="default_task" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="default_entry" type="C" size="8">
+ <NOTNULL/>
+ <DEFAULT value="index"/>
+ </field>
+ </table>
+ <table name="registrations">
+ <field name="reg_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="reg_time" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="confirm_code" type="C" size="20">
+ <NOTNULL/>
+ </field>
+ <field name="user_name" type="C" size="32">
+ <NOTNULL/>
+ </field>
+ <field name="real_name" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="email_address" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="jabber_id" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="notify_type" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="magic_url" type="C" size="40">
+ <NOTNULL/>
+ </field>
+ <field name="time_zone" type="I" size="6">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="related">
+ <field name="related_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="this_task" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="related_task" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="is_duplicate" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="this_task">
+ <UNIQUE/>
+ <col>this_task</col>
+ <col>related_task</col>
+ <col>is_duplicate</col>
+ </index>
+ </table>
+ <table name="reminders">
+ <field name="reminder_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="to_user_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="from_user_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="start_time" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="how_often" type="I" size="12">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="last_sent" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="reminder_message" type="X">
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="searches">
+ <field name="id" type="I" size="11">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="user_id" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="name" type="C" size="50">
+ <NOTNULL/>
+ </field>
+ <field name="search_string" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="time" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="tasks">
+ <field name="task_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="task_type" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="date_opened" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="opened_by" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="is_closed" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="date_closed" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="closed_by" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="closure_comment" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="item_summary" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="detailed_desc" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="item_status" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="resolution_reason" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="1"/>
+ </field>
+ <field name="product_category" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="product_version" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="closedby_version" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="operating_system" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="task_severity" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="task_priority" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="last_edited_by" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="last_edited_time" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="percent_complete" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="mark_private" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="due_date" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="anon_email" type="C" size="100">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="task_token" type="C" size="32">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="attached_to_project">
+ <col>project_id</col>
+ </index>
+ <index name="task_severity">
+ <col>task_severity</col>
+ </index>
+ <index name="task_type">
+ <col>task_type</col>
+ </index>
+ <index name="product_category">
+ <col>product_category</col>
+ </index>
+ <index name="item_status">
+ <col>item_status</col>
+ </index>
+ <index name="is_closed">
+ <col>is_closed</col>
+ </index>
+ <index name="closedby_version">
+ <col>closedby_version</col>
+ </index>
+ <index name="due_date">
+ <col>due_date</col>
+ </index>
+ </table>
+ <table name="users">
+ <field name="user_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="user_name" type="C" size="32">
+ <NOTNULL/>
+ </field>
+ <field name="user_pass" type="C" size="40"/>
+ <field name="real_name" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="jabber_id" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="email_address" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="notify_type" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="notify_own" type="I" size="6">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="account_enabled" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="dateformat" type="C" size="30">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="dateformat_extended" type="C" size="30">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="magic_url" type="C" size="40">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="tasks_perpage" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="register_date" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="time_zone" type="I" size="6">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="user_name">
+ <UNIQUE/>
+ <col>user_name</col>
+ </index>
+ </table>
+ <table name="users_in_groups">
+ <field name="record_id" type="I" size="5">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="user_id" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="group_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="group_id_uig">
+ <UNIQUE/>
+ <col>group_id</col>
+ <col>user_id</col>
+ </index>
+ <index name="user_id_uig">
+ <col>user_id</col>
+ </index>
+ </table>
+ <table name="votes">
+ <field name="vote_id" type="I" size="11">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="user_id" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="task_id" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="date_time" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+</schema>
diff --git a/setup/upgrade/0.9.9/flyspray-install.xml b/setup/upgrade/0.9.9/flyspray-install.xml
new file mode 100644
index 0000000..7496241
--- /dev/null
+++ b/setup/upgrade/0.9.9/flyspray-install.xml
@@ -0,0 +1,1044 @@
+<?xml version="1.0"?>
+<schema version="0.3">
+ <table name="admin_requests">
+ <field name="request_id" type="I" size="5">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_id" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="task_id" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="submitted_by" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="request_type" type="I" size="2">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="reason_given" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="time_submitted" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="resolved_by" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="time_resolved" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="deny_reason" type="C" size="255">
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="assigned">
+ <field name="assigned_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="user_id" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="task_user">
+ <UNIQUE/>
+ <col>task_id</col>
+ <col>user_id</col>
+ </index>
+ <index name="task_id_assigned">
+ <col>task_id</col>
+ <col>user_id</col>
+ </index>
+ </table>
+ <table name="attachments">
+ <field name="attachment_id" type="I" size="5">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="comment_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="orig_name" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="file_name" type="C" size="30">
+ <NOTNULL/>
+ </field>
+ <field name="file_desc" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="file_type" type="C" size="50">
+ <NOTNULL/>
+ </field>
+ <field name="file_size" type="I" size="20">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="added_by" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="date_added" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="task_id_attachments">
+ <col>task_id</col>
+ <col>comment_id</col>
+ </index>
+ </table>
+ <table name="cache">
+ <field name="id" type="I" size="6">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="type" type="C" size="4">
+ <NOTNULL/>
+ </field>
+ <field name="content" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="topic" type="C" size="30">
+ <NOTNULL/>
+ </field>
+ <field name="last_updated" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="project_id" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="max_items" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="cache_type">
+ <UNIQUE/>
+ <col>type</col>
+ <col>topic</col>
+ <col>project_id</col>
+ <col>max_items</col>
+ </index>
+ </table>
+ <table name="comments">
+ <field name="comment_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="date_added" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="user_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="comment_text" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="last_edited_time" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="task_id_comments">
+ <col>task_id</col>
+ </index>
+ </table>
+ <table name="dependencies">
+ <field name="depend_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="dep_task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="task_id_deps">
+ <UNIQUE/>
+ <col>task_id</col>
+ <col>dep_task_id</col>
+ </index>
+ </table>
+ <table name="groups">
+ <field name="group_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="group_name" type="C" size="20">
+ <NOTNULL/>
+ </field>
+ <field name="group_desc" type="C" size="150">
+ <NOTNULL/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="is_admin" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="manage_project" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="view_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="open_new_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="modify_own_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="modify_all_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="view_comments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="add_comments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="edit_comments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="edit_own_comments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="delete_comments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="create_attachments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="delete_attachments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="view_history" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="close_own_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="close_other_tasks" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="assign_to_self" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="assign_others_to_self" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="add_to_assignees" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="view_reports" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="add_votes" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="edit_assignments" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="group_open" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="group_name">
+ <UNIQUE/>
+ <col>group_name</col>
+ <col>project_id</col>
+ </index>
+ <index name="belongs_to_project">
+ <col>project_id</col>
+ </index>
+ </table>
+ <table name="history">
+ <field name="history_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="user_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="event_date" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="event_type" type="I" size="2">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="field_changed" type="C" size="50">
+ <NOTNULL/>
+ </field>
+ <field name="old_value" type="X" />
+ <field name="new_value" type="X" />
+ <index name="idx_task_id">
+ <col>task_id</col>
+ </index>
+ </table>
+ <table name="list_category">
+ <field name="category_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="category_name" type="C" size="30">
+ <NOTNULL/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="category_owner" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="lft" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ <UNSIGNED/>
+ </field>
+ <field name="rgt" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ <UNSIGNED/>
+ </field>
+ <index name="project_id_cat">
+ <col>project_id</col>
+ </index>
+ </table>
+ <table name="list_os">
+ <field name="os_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="os_name" type="C" size="20">
+ <NOTNULL/>
+ </field>
+ <field name="list_position" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="project_id_os">
+ <col>project_id</col>
+ </index>
+ </table>
+ <table name="list_resolution">
+ <field name="resolution_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="resolution_name" type="C" size="30">
+ <NOTNULL/>
+ </field>
+ <field name="list_position" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="project_id_res">
+ <col>project_id</col>
+ </index>
+ </table>
+ <table name="list_status">
+ <field name="status_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="status_name" type="C" size="20">
+ <NOTNULL/>
+ </field>
+ <field name="list_position" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="project_id_status">
+ <col>project_id</col>
+ </index>
+ </table>
+ <table name="list_tasktype">
+ <field name="tasktype_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="tasktype_name" type="C" size="20">
+ <NOTNULL/>
+ </field>
+ <field name="list_position" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="project_id_tt">
+ <col>project_id</col>
+ </index>
+ </table>
+ <table name="list_version">
+ <field name="version_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="version_name" type="C" size="20">
+ <NOTNULL/>
+ </field>
+ <field name="list_position" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="show_in_list" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="version_tense" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="project_id_version">
+ <col>project_id</col>
+ <col>version_tense</col>
+ </index>
+ </table>
+ <table name="notification_messages">
+ <field name="message_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="message_subject" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="message_body" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="time_created" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="notification_recipients">
+ <field name="recipient_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="message_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="notify_method" type="C" size="1">
+ <NOTNULL/>
+ </field>
+ <field name="notify_address" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="notifications">
+ <field name="notify_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="user_id" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="task_id_notifs">
+ <UNIQUE/>
+ <col>task_id</col>
+ <col>user_id</col>
+ </index>
+ </table>
+ <table name="prefs">
+ <field name="pref_id" type="I" size="1">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="pref_name" type="C" size="20">
+ <NOTNULL/>
+ </field>
+ <field name="pref_value" type="C" size="250">
+ <DEFAULT value="0"/>
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="projects">
+ <field name="project_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_title" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="theme_style" type="C" size="20">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="default_cat_owner" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="intro_message" type="X">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="project_is_active" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="visible_columns" type="C" size="255">
+ <NOTNULL/>
+ </field>
+ <field name="others_view" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="anon_open" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="notify_email" type="X">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="notify_jabber" type="X">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="notify_reply" type="X">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="notify_types" type="C" size="100">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="feed_img_url" type="X">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="feed_description" type="X">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="notify_subject" type="C" size="100">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="lang_code" type="C" size="10">
+ <NOTNULL/>
+ </field>
+ <field name="comment_closed" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="auto_assign" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="last_updated" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="default_task" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="default_entry" type="C" size="8">
+ <NOTNULL/>
+ <DEFAULT value="index"/>
+ </field>
+ </table>
+ <table name="registrations">
+ <field name="reg_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="reg_time" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="confirm_code" type="C" size="20">
+ <NOTNULL/>
+ </field>
+ <field name="user_name" type="C" size="32">
+ <NOTNULL/>
+ </field>
+ <field name="real_name" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="email_address" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="jabber_id" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="notify_type" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="magic_url" type="C" size="40">
+ <NOTNULL/>
+ </field>
+ <field name="time_zone" type="I" size="6">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="related">
+ <field name="related_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="this_task" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="related_task" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="is_duplicate" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="this_task">
+ <UNIQUE/>
+ <col>this_task</col>
+ <col>related_task</col>
+ <col>is_duplicate</col>
+ </index>
+ </table>
+ <table name="reminders">
+ <field name="reminder_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="task_id" type="I" size="10">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="to_user_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="from_user_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="start_time" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="how_often" type="I" size="12">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="last_sent" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="reminder_message" type="X">
+ <NOTNULL/>
+ </field>
+ </table>
+ <table name="searches">
+ <field name="id" type="I" size="11">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="user_id" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="name" type="C" size="50">
+ <NOTNULL/>
+ </field>
+ <field name="search_string" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="time" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <table name="tasks">
+ <field name="task_id" type="I" size="10">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="project_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="task_type" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="date_opened" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="opened_by" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="is_closed" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="date_closed" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="closed_by" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="closure_comment" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="item_summary" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="detailed_desc" type="X">
+ <NOTNULL/>
+ </field>
+ <field name="item_status" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="resolution_reason" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="1"/>
+ </field>
+ <field name="product_category" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="product_version" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="closedby_version" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="operating_system" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="task_severity" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="task_priority" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="last_edited_by" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="last_edited_time" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="percent_complete" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="mark_private" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="due_date" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="anon_email" type="C" size="100">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="task_token" type="C" size="32">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="attached_to_project">
+ <col>project_id</col>
+ </index>
+ <index name="task_severity">
+ <col>task_severity</col>
+ </index>
+ <index name="task_type">
+ <col>task_type</col>
+ </index>
+ <index name="product_category">
+ <col>product_category</col>
+ </index>
+ <index name="item_status">
+ <col>item_status</col>
+ </index>
+ <index name="is_closed">
+ <col>is_closed</col>
+ </index>
+ <index name="closedby_version">
+ <col>closedby_version</col>
+ </index>
+ <index name="due_date">
+ <col>due_date</col>
+ </index>
+ </table>
+ <table name="users">
+ <field name="user_id" type="I" size="3">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="user_name" type="C" size="32">
+ <NOTNULL/>
+ </field>
+ <field name="user_pass" type="C" size="40"/>
+ <field name="real_name" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="jabber_id" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="email_address" type="C" size="100">
+ <NOTNULL/>
+ </field>
+ <field name="notify_type" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="notify_own" type="I" size="6">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="account_enabled" type="I" size="1">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="dateformat" type="C" size="30">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="dateformat_extended" type="C" size="30">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="magic_url" type="C" size="40">
+ <NOTNULL/>
+ <DEFAULT value=""/>
+ </field>
+ <field name="tasks_perpage" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="register_date" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="time_zone" type="I" size="6">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="user_name">
+ <UNIQUE/>
+ <col>user_name</col>
+ </index>
+ </table>
+ <table name="users_in_groups">
+ <field name="record_id" type="I" size="5">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="user_id" type="I" size="5">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="group_id" type="I" size="3">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <index name="group_id_uig">
+ <UNIQUE/>
+ <col>group_id</col>
+ <col>user_id</col>
+ </index>
+ <index name="user_id_uig">
+ <col>user_id</col>
+ </index>
+ </table>
+ <table name="votes">
+ <field name="vote_id" type="I" size="11">
+ <KEY/>
+ <AUTOINCREMENT/>
+ </field>
+ <field name="user_id" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="task_id" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ <field name="date_time" type="I" size="11">
+ <NOTNULL/>
+ <DEFAULT value="0"/>
+ </field>
+ </table>
+ <sql>
+ <query>INSERT INTO groups VALUES (DEFAULT, 'Admin', 'Members have unlimited access to all functionality.', 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1);</query>
+ <query>INSERT INTO groups VALUES (DEFAULT, 'Developers', 'Global Developers for all projects', 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1);</query>
+ <query>INSERT INTO groups VALUES (DEFAULT, 'Reporters', 'Open new tasks / add comments in all projects', 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1);</query>
+ <query>INSERT INTO groups VALUES (DEFAULT, 'Basic', 'Members can login, relying upon Project permissions only', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1);</query>
+ <query>INSERT INTO groups VALUES (DEFAULT, 'Pending', 'Users who are awaiting approval of their accounts.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);</query>
+ <query>INSERT INTO groups VALUES (DEFAULT, 'Project Managers', 'Permission to do anything related to the Default Project.', 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1);</query>
+ <query>INSERT INTO history VALUES (DEFAULT, 1, 1, 1130024797, 1, '', '', '');</query>
+ <query>INSERT INTO list_category VALUES (DEFAULT, 1, 'Backend / Core', 1, 0, 2, 3);</query>
+ <query>INSERT INTO list_category VALUES (DEFAULT, 0, 'root', 0, 0, 1, 2);</query>
+ <query>INSERT INTO list_category VALUES (DEFAULT, 1, 'root', 0, 0, 1, 4);</query>
+ <query>INSERT INTO list_os VALUES (DEFAULT, 1, 'All', 1, 1);</query>
+ <query>INSERT INTO list_os VALUES (DEFAULT, 1, 'Windows', 2, 1);</query>
+ <query>INSERT INTO list_os VALUES (DEFAULT, 1, 'Linux', 3, 1);</query>
+ <query>INSERT INTO list_os VALUES (DEFAULT, 1, 'Mac OS', 4, 1);</query>
+ <query>INSERT INTO list_resolution VALUES (DEFAULT, 'Not a bug', 1, 1, 0);</query>
+ <query>INSERT INTO list_resolution VALUES (DEFAULT, 'Won''t fix', 2, 1, 0);</query>
+ <query>INSERT INTO list_resolution VALUES (DEFAULT, 'Won''t implement', 3, 1, 0);</query>
+ <query>INSERT INTO list_resolution VALUES (DEFAULT, 'Works for me', 4, 1, 0);</query>
+ <query>INSERT INTO list_resolution VALUES (DEFAULT, 'Deferred', 5, 1, 0);</query>
+ <query>INSERT INTO list_resolution VALUES (DEFAULT, 'Duplicate', 6, 1, 0);</query>
+ <query>INSERT INTO list_resolution VALUES (DEFAULT, 'Fixed', 7, 1, 0);</query>
+ <query>INSERT INTO list_resolution VALUES (DEFAULT, 'Implemented', 8, 1, 0);</query>
+ <query>INSERT INTO list_tasktype VALUES (DEFAULT, 'Bug Report', 1, 1, 0);</query>
+ <query>INSERT INTO list_tasktype VALUES (DEFAULT, 'Feature Request', 2, 1, 0);</query>
+ <query>INSERT INTO list_version VALUES (DEFAULT, 1, 'Development', 1, 1, 2);</query>
+ <query>INSERT INTO list_status (status_name, list_position, show_in_list, project_id) VALUES ('Unconfirmed', 1, 1, 0)</query>
+ <query>INSERT INTO list_status (status_name, list_position, show_in_list, project_id) VALUES ('New', 2, 1, 0)</query>
+ <query>INSERT INTO list_status (status_name, list_position, show_in_list, project_id) VALUES ('Assigned', 3, 1, 0)</query>
+ <query>INSERT INTO list_status (status_name, list_position, show_in_list, project_id) VALUES ('Researching', 4, 1, 0)</query>
+ <query>INSERT INTO list_status (status_name, list_position, show_in_list, project_id) VALUES ('Waiting on Customer', 5, 1, 0)</query>
+ <query>INSERT INTO list_status (status_name, list_position, show_in_list, project_id) VALUES ('Requires testing', 6, 1, 0)</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'fs_ver', '0.9.9');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'jabber_server', '');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'jabber_port', '5222');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'jabber_username', '');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'jabber_password', '');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'anon_group', '4');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'user_notify', '1');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'admin_email', 'flyspray@example.com');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'lang_code', 'en');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'spam_proof', '1');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'default_project', '1');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'dateformat', '');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'dateformat_extended', '');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'anon_reg', '1');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'global_theme', 'CleanFS');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'visible_columns', 'id project category tasktype severity summary status progress');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'smtp_server', '');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'smtp_user', '');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'smtp_pass', '');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'page_title', 'Flyspray::');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'notify_registration', '0');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'jabber_ssl', '0');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'last_update_check', '0');</query>
+ <query>INSERT INTO prefs VALUES (DEFAULT, 'cache_feeds', '1');</query>
+ <query>INSERT INTO projects VALUES (DEFAULT, 'Default Project', 'CleanFS', 0, 'Welcome to your first Flyspray project! We hope that Flyspray provides you with many hours of increased productivity. If you have any issues, go to http://flyspray.org/support. You can customise this message by clicking the **Manage Project** link in the menu above...', 1, 'id category tasktype severity summary status progress', 1, 0, '', '', NULL, '0', NULL, NULL, '', 'en', 0, 0, 0, NULL, 'index');</query>
+ <query>INSERT INTO tasks VALUES (1, 1, 1, 1130024797, 1, 0, 0, 0, ' ', 'Sample Task', 'This isn''t a real task. You should close it and start opening some real tasks.', 2, 1, 1, 1, 0, 1, 1, 2, 0, 0, 0, 0, 0, '', '0');</query>
+ <query>INSERT INTO users VALUES (DEFAULT, 'super', '1b3231655cebb7a1f783eddf27d254ca', 'Mr Super User', 'super@example.com', 'super@example.com', 0, 1, 1, '', '', 25, 0, 0, 0);</query>
+ <query>INSERT INTO users_in_groups VALUES (DEFAULT, 1, 1);</query>
+ </sql>
+</schema>
diff --git a/setup/upgrade/0.9.9/rename_columns.php b/setup/upgrade/0.9.9/rename_columns.php
new file mode 100644
index 0000000..07a949a
--- /dev/null
+++ b/setup/upgrade/0.9.9/rename_columns.php
@@ -0,0 +1,14 @@
+<?php
+ /**********************************************************\
+ | This script renames columns, adodb seems to have prob here|
+ \**********************************************************/
+
+$dict = NewDataDictionary($db->dblink);
+
+$sqlarray = $dict->RenameColumnSQL($conf['database']['dbprefix'] . 'tasks', 'attached_to_project', 'project_id', 'TYPE INT(3) NOTNULL DEFAULT 0');
+$dict->ExecuteSQLArray($sqlarray);
+
+$sqlarray = $dict->RenameColumnSQL($conf['database']['dbprefix'] . 'groups', 'belongs_to_project', 'project_id', ' TYPE INT(3) NOTNULL DEFAULT 0');
+$dict->ExecuteSQLArray($sqlarray);
+
+?> \ No newline at end of file
diff --git a/setup/upgrade/0.9.9/upgrade.info b/setup/upgrade/0.9.9/upgrade.info
new file mode 100644
index 0000000..e5ea7e5
--- /dev/null
+++ b/setup/upgrade/0.9.9/upgrade.info
@@ -0,0 +1,44 @@
+[defaultupgrade]
+0="clean_unique.php"
+1="flyspray-begin.xml"
+2="upgrade_assignments.php"
+3="convert_categories.php"
+4="convert_private.php"
+5="add_duplicates.php"
+6="add_searches.php"
+7="rename_columns.php"
+8="flyspray-final.xml"
+9="add_data.php"
+
+[develupgrade]
+1="flyspray-final.xml"
+
+[options]
+
+1="<div><label><input name='replace_resolution' checked='checked' type='checkbox'/> Edit resolution list (strongly recommended for 0.9.8 to 0.9.9)</label></div>"
+
+[fsprefs]
+fs_ver="0.9.7" ; doesn't matter which version
+jabber_server=""
+jabber_port="5222"
+jabber_username=""
+jabber_password=""
+anon_group="0"
+user_notify="1"
+admin_email="flyspray@example.com"
+lang_code="en"
+spam_proof="1"
+default_project="1"
+dateformat=""
+dateformat_extended=""
+anon_reg="1"
+page_title="Flyspray:: "
+notify_registration="0"
+jabber_ssl="0"
+last_update_check="0"
+cache_feeds="1"
+global_theme="CleanFS"
+visible_columns="id project tasktype severity summary status progress"
+smtp_server=""
+smtp_user=""
+smtp_pass="" \ No newline at end of file
diff --git a/setup/upgrade/0.9.9/upgrade_assignments.php b/setup/upgrade/0.9.9/upgrade_assignments.php
new file mode 100644
index 0000000..a9aa53c
--- /dev/null
+++ b/setup/upgrade/0.9.9/upgrade_assignments.php
@@ -0,0 +1,31 @@
+<?php
+ /**********************************************************\
+ | This script moves data from {dbprefix)tasks.assigned_to |
+ | to {dbprefix}assigned. This is to implement multiple |
+ | assignees per task as described in FS#329. It only needs |
+ | to be run once to do the conversion. |
+ \***********************************************************/
+
+$check_sql = $db->query("SELECT task_id, assigned_to
+ FROM {tasks}
+ WHERE assigned_to > '0'");
+
+while ($row = $db->fetchRow($check_sql))
+{
+ $check = $db->query('SELECT assigned_id FROM {assigned} WHERE task_id = ? AND user_id = ?',
+ array($row['task_id'], $row['assigned_to']));
+ if ($db->fetchOne($check)) {
+ continue;
+ }
+
+ $db->query('INSERT INTO {assigned}
+ (task_id, user_id)
+ VALUES (?,?)',
+ array($row['task_id'], $row['assigned_to']));
+
+ $db->query('UPDATE {tasks}
+ SET assigned_to = 0
+ WHERE task_id = ?',
+ array($row['task_id']));
+}
+?>