<?php
	/**
	* Trouble Ticket System - Setup
	*
	* @copyright Copyright (C) 2001-2005 Free Software Foundation, Inc. http://www.fsf.org/
	* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
	* @package tts
	* @subpackage setup
	* @version $Id: tables_update.inc.php 19070 2009-02-11 13:52:11Z skwashd $
	*/

	/* This is since the last release */
	$test[] = '0.8.1.003';
	
	/**
	 * Upgrade from 0.8.1.003 to 0.9.16.001
	 * 
	 * @return string New version
	 */
	function tts_upgrade0_8_1_003()
	{
		$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_tts_tickets','ticket_type',array(
			'type' => 'int',
			'precision' => 2,
			'nullable' => true
			));
			
		$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_tts_tickets','ticket_deadline',array(
			'type' => 'varchar',
			'precision' => 10,
			'nullable' => true
			));
		
		$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_tts_tickets','ticket_effort',array(
			'type' => 'varchar',
			'precision' => 4,
			'nullable' => true
			));
			
		$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_tts_tickets','ticket_platform',array(
			'type' => 'int',
			'precision' => 2,
			'nullable' => true
			));

		$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_tts_tickets','ticket_attachment',array(
			'type' => 'int',
			'precision' => 2,
			'nullable' => false
			));
		
		$GLOBALS['setup_info']['tts']['currentver'] = '0.9.16.001';
		return $GLOBALS['setup_info']['tts']['currentver'];
	}

	$test[] = '0.9.16.001';
	function tts_upgrade0_9_16_001()
	{
		$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_tts_tickets','ticket_lastmod',array(
			'type' => 'int',
			'precision' => 4,
			'nullable' => false
			));

		$GLOBALS['setup_info']['tts']['currentver'] = '0.9.16.002';
		return $GLOBALS['setup_info']['tts']['currentver'];
	}
