[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/resources/setup/ -> tables_update.inc.php (source)

   1  <?php
   2    /**************************************************************************\
   3    * eGroupWare - Setup                                                       *
   4    * http://www.eGroupWare.org                                                *
   5    * Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de *
   6    * --------------------------------------------                             *
   7    * This program is free software; you can redistribute it and/or modify it  *
   8    * under the terms of the GNU General Public License as published by the    *
   9    * Free Software Foundation; either version 2 of the License, or (at your   *
  10    * option) any later version.                                               *
  11    \**************************************************************************/
  12  
  13    /* $Id: tables_update.inc.php 19821 2005-11-14 18:16:56Z nelius_weiss $ */
  14  
  15      $test[] = '0.0.1.008';
  16  	function resources_upgrade0_0_1_008()
  17      {
  18          $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','picture_src',array(
  19              'type' => 'varchar',
  20              'precision' => '20'
  21          ));
  22  
  23          $GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.012';
  24          return $GLOBALS['setup_info']['resources']['currentver'];
  25      }
  26  
  27  
  28      $test[] = '0.0.1.012';
  29  	function resources_upgrade0_0_1_012()
  30      {
  31          $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','picture_thumb',array(
  32              'type' => 'blob'
  33          ));
  34  
  35          $GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.013';
  36          return $GLOBALS['setup_info']['resources']['currentver'];
  37      }
  38  
  39  
  40      $test[] = '0.0.1.013';
  41  	function resources_upgrade0_0_1_013()
  42      {
  43          $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources',array(
  44              'fd' => array(
  45                  'id' => array('type' => 'auto'),
  46                  'name' => array('type' => 'varchar','precision' => '100'),
  47                  'short_description' => array('type' => 'varchar','precision' => '100'),
  48                  'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
  49                  'quantity' => array('type' => 'int','precision' => '11'),
  50                  'useable' => array('type' => 'int','precision' => '11'),
  51                  'location' => array('type' => 'varchar','precision' => '100'),
  52                  'bookable' => array('type' => 'varchar','precision' => '1'),
  53                  'buyable' => array('type' => 'varchar','precision' => '1'),
  54                  'prize' => array('type' => 'varchar','precision' => '200'),
  55                  'long_description' => array('type' => 'longtext'),
  56                  'accessories' => array('type' => 'varchar','precision' => '50'),
  57                  'picture_src' => array('type' => 'varchar','precision' => '20'),
  58                  'picture_thumb' => array('type' => 'blob')
  59              ),
  60              'pk' => array('id'),
  61              'fk' => array(),
  62              'ix' => array(),
  63              'uc' => array()
  64          ),'picture');
  65          $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources',array(
  66              'fd' => array(
  67                  'id' => array('type' => 'auto'),
  68                  'name' => array('type' => 'varchar','precision' => '100'),
  69                  'short_description' => array('type' => 'varchar','precision' => '100'),
  70                  'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
  71                  'quantity' => array('type' => 'int','precision' => '11'),
  72                  'useable' => array('type' => 'int','precision' => '11'),
  73                  'location' => array('type' => 'varchar','precision' => '100'),
  74                  'bookable' => array('type' => 'varchar','precision' => '1'),
  75                  'buyable' => array('type' => 'varchar','precision' => '1'),
  76                  'prize' => array('type' => 'varchar','precision' => '200'),
  77                  'long_description' => array('type' => 'longtext'),
  78                  'accessories' => array('type' => 'varchar','precision' => '50'),
  79                  'picture_src' => array('type' => 'varchar','precision' => '20')
  80              ),
  81              'pk' => array('id'),
  82              'fk' => array(),
  83              'ix' => array(),
  84              'uc' => array()
  85          ),'picture_thumb');
  86  
  87          $GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.014';
  88          return $GLOBALS['setup_info']['resources']['currentver'];
  89      }
  90  
  91  
  92      $test[] = '0.0.1.014';
  93  	function resources_upgrade0_0_1_014()
  94      {
  95          $GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','quantity',array(
  96              'type' => 'int',
  97              'precision' => '11',
  98              'default' => '1'
  99          ));
 100          $GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','useable',array(
 101              'type' => 'int',
 102              'precision' => '11',
 103              'default' => '1'
 104          ));
 105  
 106          $GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.015';
 107          return $GLOBALS['setup_info']['resources']['currentver'];
 108      }
 109  
 110  
 111      $test[] = '0.0.1.015';
 112  	function resources_upgrade0_0_1_015()
 113      {
 114          $GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','accessories',array(
 115              'type' => 'varchar',
 116              'precision' => '100'
 117          ));
 118          $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','accessory_only',array(
 119              'type' => 'varchar',
 120              'precision' => '1',
 121              'default' => '0'
 122          ));
 123          $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','relatives',array(
 124              'type' => 'varchar',
 125              'precision' => '100'
 126          ));
 127  
 128          $GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.016';
 129          return $GLOBALS['setup_info']['resources']['currentver'];
 130      }
 131  
 132  
 133      $test[] = '0.0.1.016';
 134  	function resources_upgrade0_0_1_016()
 135      {
 136          $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources',array(
 137              'fd' => array(
 138                  'id' => array('type' => 'auto'),
 139                  'name' => array('type' => 'varchar','precision' => '100'),
 140                  'short_description' => array('type' => 'varchar','precision' => '100'),
 141                  'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
 142                  'quantity' => array('type' => 'int','precision' => '11','default' => '1'),
 143                  'useable' => array('type' => 'int','precision' => '11','default' => '1'),
 144                  'location' => array('type' => 'varchar','precision' => '100'),
 145                  'bookable' => array('type' => 'varchar','precision' => '1'),
 146                  'buyable' => array('type' => 'varchar','precision' => '1'),
 147                  'prize' => array('type' => 'varchar','precision' => '200'),
 148                  'long_description' => array('type' => 'longtext'),
 149                  'accessories' => array('type' => 'varchar','precision' => '100'),
 150                  'picture_src' => array('type' => 'varchar','precision' => '20'),
 151                  'relatives' => array('type' => 'varchar','precision' => '100')
 152              ),
 153              'pk' => array('id'),
 154              'fk' => array(),
 155              'ix' => array(),
 156              'uc' => array()
 157          ),'accessory_only');
 158          $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources',array(
 159              'fd' => array(
 160                  'id' => array('type' => 'auto'),
 161                  'name' => array('type' => 'varchar','precision' => '100'),
 162                  'short_description' => array('type' => 'varchar','precision' => '100'),
 163                  'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
 164                  'quantity' => array('type' => 'int','precision' => '11','default' => '1'),
 165                  'useable' => array('type' => 'int','precision' => '11','default' => '1'),
 166                  'location' => array('type' => 'varchar','precision' => '100'),
 167                  'bookable' => array('type' => 'varchar','precision' => '1'),
 168                  'buyable' => array('type' => 'varchar','precision' => '1'),
 169                  'prize' => array('type' => 'varchar','precision' => '200'),
 170                  'long_description' => array('type' => 'longtext'),
 171                  'accessories' => array('type' => 'varchar','precision' => '100'),
 172                  'picture_src' => array('type' => 'varchar','precision' => '20')
 173              ),
 174              'pk' => array('id'),
 175              'fk' => array(),
 176              'ix' => array(),
 177              'uc' => array()
 178          ),'relatives');
 179          $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources',array(
 180              'fd' => array(
 181                  'id' => array('type' => 'auto'),
 182                  'name' => array('type' => 'varchar','precision' => '100'),
 183                  'short_description' => array('type' => 'varchar','precision' => '100'),
 184                  'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
 185                  'quantity' => array('type' => 'int','precision' => '11','default' => '1'),
 186                  'useable' => array('type' => 'int','precision' => '11','default' => '1'),
 187                  'location' => array('type' => 'varchar','precision' => '100'),
 188                  'bookable' => array('type' => 'varchar','precision' => '1'),
 189                  'buyable' => array('type' => 'varchar','precision' => '1'),
 190                  'prize' => array('type' => 'varchar','precision' => '200'),
 191                  'long_description' => array('type' => 'longtext'),
 192                  'picture_src' => array('type' => 'varchar','precision' => '20')
 193              ),
 194              'pk' => array('id'),
 195              'fk' => array(),
 196              'ix' => array(),
 197              'uc' => array()
 198          ),'accessories');
 199          $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','accessory_of',array(
 200              'type' => 'int',
 201              'precision' => '11',
 202              'default' => '-1'
 203          ));
 204          $GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.017';
 205          return $GLOBALS['setup_info']['resources']['currentver'];
 206      }
 207  
 208  
 209      $test[] = '0.0.1.017';
 210  	function resources_upgrade0_0_1_017()
 211      {
 212          $GLOBALS['phpgw_setup']->oProc->RenameColumn('egw_resources','id','res_id');
 213          $GLOBALS['phpgw_setup']->oProc->RefreshTable('egw_resources',array(
 214              'fd' => array(
 215                  'res_id' => array('type' => 'auto'),
 216                  'name' => array('type' => 'varchar','precision' => '100'),
 217                  'short_description' => array('type' => 'varchar','precision' => '100'),
 218                  'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
 219                  'quantity' => array('type' => 'int','precision' => '11','default' => '1'),
 220                  'useable' => array('type' => 'int','precision' => '11','default' => '1'),
 221                  'location' => array('type' => 'varchar','precision' => '100'),
 222                  'bookable' => array('type' => 'varchar','precision' => '1'),
 223                  'buyable' => array('type' => 'varchar','precision' => '1'),
 224                  'prize' => array('type' => 'varchar','precision' => '200'),
 225                  'long_description' => array('type' => 'longtext'),
 226                  'picture_src' => array('type' => 'varchar','precision' => '20'),
 227                  'accessory_of' => array('type' => 'int','precision' => '11','default' => '-1')
 228              ),
 229              'pk' => array('res_id'),
 230              'fk' => array(),
 231              'ix' => array(),
 232              'uc' => array()
 233          ));
 234  
 235          $GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.018';
 236          return $GLOBALS['setup_info']['resources']['currentver'];
 237      }
 238  
 239  
 240      $test[] = '0.0.1.018';
 241  	function resources_upgrade0_0_1_018()
 242      {
 243          $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','storage_info',array(
 244              'type' => 'varchar',
 245              'precision' => '200'
 246          ));
 247  
 248          $GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.019';
 249          return $GLOBALS['setup_info']['resources']['currentver'];
 250      }
 251  
 252  
 253      $test[] = '0.0.1.019';
 254  	function resources_upgrade0_0_1_019()
 255      {
 256          $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','inventory_number',array(
 257              'type' => 'varchar',
 258              'precision' => '20'
 259          ));
 260  
 261          $GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.020';
 262          return $GLOBALS['setup_info']['resources']['currentver'];
 263      }
 264  
 265  
 266      $test[] = '0.0.1.020';
 267  	function resources_upgrade0_0_1_020()
 268      {
 269          $GLOBALS['egw_setup']->oProc->CreateTable('egw_resources_extra',array(
 270              'fd' => array(
 271                  'extra_id' => array('type' => 'int','precision' => '4','nullable' => False),
 272                  'extra_name' => array('type' => 'varchar','precision' => '40','nullable' => False),
 273                  'extra_owner' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '-1'),
 274                  'extra_value' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '')
 275              ),
 276              'pk' => array('extra_id','extra_name','extra_owner'),
 277              'fk' => array(),
 278              'ix' => array(),
 279              'uc' => array()
 280          ));
 281  
 282          return $GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.021';
 283      }
 284      
 285      $test[] = '0.0.1.021';
 286  	function resources_upgrade0_0_1_021()
 287      {
 288          return $GLOBALS['setup_info']['resources']['currentver'] = '1.2';
 289      }
 290  ?>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7