<?php
  /**************************************************************************\
  * phpGroupWare - Setup                                                     *
  * http://www.phpgroupware.org                                              *
  * --------------------------------------------                             *
  *  This program is free software; you can redistribute it and/or modify it *
  *  under the terms of the GNU General Public License as published by the   *
  *  Free Software Foundation; either version 2 of the License, or (at your  *
  *  option) any later version.                                              *
  \**************************************************************************/

  /* $Id: tables_update.inc.php,v 1.8.2.2 2002/05/14 21:48:53 ceb Exp $ */

	$test[] = "0.9.1";
	function notes_upgrade0_9_1()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.2';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.2";
	function notes_upgrade0_9_2()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.3pre1';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.3pre1";
	function notes_upgrade0_9_3pre1()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.3pre2';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.3pre2";
	function notes_upgrade0_9_3pre2()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.3pre3';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.3pre3";
	function notes_upgrade0_9_3pre3()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.3pre4';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.3pre4";
	function notes_upgrade0_9_3pre4()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.3pre5';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.3pre5";
	function notes_upgrade0_9_3pre5()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.3pre6';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.3pre6";
	function notes_upgrade0_9_3pre6()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.3pre7';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.3pre7";
	function notes_upgrade0_9_3pre7()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.3pre8';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.3pre8";
	function notes_upgrade0_9_3pre8()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.3pre9';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.3pre9";
	function notes_upgrade0_9_3pre9()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.3pre10';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.3pre10";
	function notes_upgrade0_9_3pre10()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.3';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.3";
	function notes_upgrade0_9_3()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.4pre1';
		return $setup_info['notes']['currentver'];
	}

	$test[] = '0.9.4pre1';
	function notes_upgrade0_9_4pre1()
	{
		global $setup_info, $phpgw_setup;

		$phpgw_setup->oProc->CreateTable(
			'notes', array(
				'fd' => array(
					'note_id' => array('type' => 'auto', 'nullable' => false),
					'note_owner' => array('type' => 'int', 'precision' => 4),
					'note_date' => array('type' => 'int', 'precision' => 4),
					'note_content' => array('type' => 'text')
				),
				'pk' => array('note_id'),
				'ix' => array(),
				'fk' => array(),
				'uc' => array()
			)
		);

		$setup_info['notes']['currentver'] = '0.9.4pre2';
		return $setup_info['notes']['currentver'];
	}

	$test[] = "0.9.4pre3";
	function notes_upgrade0_9_4pre3()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.4pre4';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.4pre4";
	function notes_upgrade0_9_4pre4()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.4pre5';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.4pre5";
	function notes_upgrade0_9_4pre5()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.4';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.4";
	function notes_upgrade0_9_4()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.5pre1';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.5pre1";
	function notes_upgrade0_9_5pre1()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.5pre2';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.5pre2";
	function notes_upgrade0_9_5pre2()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.5';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.5";
	function notes_upgrade0_9_5()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.6';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.6";
	function notes_upgrade0_9_6()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.7pre1';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.7pre1";
	function notes_upgrade0_9_7pre1()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.7pre2';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.7pre2";
	function notes_upgrade0_9_7pre2()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.7pre3';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.7pre3";
	function notes_upgrade0_9_7pre3()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.7';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.7";
	function notes_upgrade0_9_7()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.8pre1';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.8pre1";
	function notes_upgrade0_9_8pre1()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.8pre2';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.8pre2";
	function notes_upgrade0_9_8pre2()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.8pre3';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.8pre3";
	function notes_upgrade0_9_8pre3()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.8pre4';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.8pre4";
	function notes_upgrade0_9_8pre4()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.8pre5';
		return $setup_info['notes']['currentver'];
	}

	$test[] = '0.9.8pre5';
	function notes_upgrade0_9_8pre5()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre11';
		return $setup_info['notes']['currentver'];
	}

	$test[] = "0.9.9pre1";
	function notes_upgrade0_9_9pre1()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.9';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.9";
	function notes_upgrade0_9_9()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre1';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.10pre1";
	function notes_upgrade0_9_10pre1()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre2';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.10pre2";
	function notes_upgrade0_9_10pre2()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre3';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.10pre3";
	function notes_upgrade0_9_10pre3()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre4';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.10pre4";
	function notes_upgrade0_9_10pre4()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre5';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.10pre5";
	function notes_upgrade0_9_10pre5()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre6';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.10pre6";
	function notes_upgrade0_9_10pre6()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre7';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.10pre7";
	function notes_upgrade0_9_10pre7()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre8';
		return $setup_info['notes']['currentver'];
	}
	$test[] = "0.9.10pre8";
	function notes_upgrade0_9_10pre8()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre9';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre9';
	function notes_upgrade0_9_10pre9()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre10';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre10';
	function notes_upgrade0_9_10pre10()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre11';
		return $setup_info['notes']['currentver'];
	}

	$test[] = '0.9.10pre11';
	function notes_upgrade0_9_10pre11()
	{
		global $phpgw_info, $phpgw_setup;

		$phpgw_setup->oProc->RenameTable('notes','phpgw_notes');
		$phpgw_setup->oProc->AddColumn('phpgw_notes','note_category',array('type' => 'int', 'precision' => 4));

		$setup_info['notes']['currentver'] = '0.9.10pre12';
		return $setup_info['notes']['currentver'];
	}

	$test[] = '0.9.10pre12';
	function notes_upgrade0_9_10pre12()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre13';
		return $setup_info['notes']['currentver'];
	}

	$test[] = '0.9.10pre13';
	function notes_upgrade0_9_10pre13()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre14';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre14';
	function notes_upgrade0_9_10pre14()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre15';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre15';
	function notes_upgrade0_9_10pre15()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre16';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre16';
	function notes_upgrade0_9_10pre16()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre17';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre17';
	function notes_upgrade0_9_10pre17()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre18';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre18';
	function notes_upgrade0_9_10pre18()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre19';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre19';
	function notes_upgrade0_9_10pre19()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre20';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre20';
	function notes_upgrade0_9_10pre20()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre21';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre21';
	function notes_upgrade0_9_10pre21()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre22';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre22';
	function notes_upgrade0_9_10pre22()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre23';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre23';
	function notes_upgrade0_9_10pre23()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre24';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre24';
	function notes_upgrade0_9_10pre24()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre25';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre25';
	function notes_upgrade0_9_10pre25()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre26';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre26';
	function notes_upgrade0_9_10pre26()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre27';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre27';
	function notes_upgrade0_9_10pre27()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10pre28';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10pre28';
	function notes_upgrade0_9_10pre28()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.10';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.10';
	function notes_upgrade0_9_10()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.11.001';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.11';
	function notes_upgrade0_9_11()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.11.001';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.11.001';
	function notes_upgrade0_9_11_001()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.11.002';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.11.002';
	function notes_upgrade0_9_11_002()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.11.003';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.11.003';
	function notes_upgrade0_9_11_003()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.11.004';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.11.004';
	function notes_upgrade0_9_11_004()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.11.005';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.11.005';
	function notes_upgrade0_9_11_005()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.11.006';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.11.006';
	function notes_upgrade0_9_11_006()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.11.007';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.11.007';
	function notes_upgrade0_9_11_007()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.11.008';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.11.008';
	function notes_upgrade0_9_11_008()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.11.009';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.11.009';
	function notes_upgrade0_9_11_009()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.11.010';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.11.010';
	function notes_upgrade0_9_11_010()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.11.011';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.11.011';
	function notes_upgrade0_9_11_011()
	{
		global $setup_info;
		$setup_info['notes']['currentver'] = '0.9.13.001';
		return $setup_info['notes']['currentver'];
	}
	$test[] = '0.9.12';
	function notes_upgrade0_9_12()
	{
		$GLOBALS['setup_info']['notes']['currentver'] = '0.9.13.001';
		return $GLOBALS['setup_info']['notes']['currentver'];
	}
	$test[] = '0.9.13.001';
	function notes_upgrade0_9_13_001()
	{
		global $setup_info,$phpgw_setup;

		$phpgw_setup->oProc->AlterColumn('phpgw_notes','note_access', array('type' => 'varchar', 'precision' => 7));

		$setup_info['notes']['currentver'] = '0.9.13.002';
		return $setup_info['notes']['currentver'];
	}

	$test[] = '0.9.13.002';
	function notes_upgrade0_9_13_002()
	{
		$GLOBALS['setup_info']['notes']['currentver'] = '0.9.14';
		return $GLOBALS['setup_info']['notes']['currentver'];
	}
?>
