[ Index ]
 

Code source de eGroupWare 1.2.106-2

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

title

Body

[fermer]

/wiki/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 20295 2006-02-15 12:31:25Z  $ */
  14  
  15      $test[] = '0.9.15.001';
  16  	function wiki_upgrade0_9_15_001()
  17      {
  18          // this will also create the new colums, with its default values and discards the not longer used mutable column
  19          $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_wiki_pages',array(
  20              'fd' => array(
  21                  'wiki_id' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '0'),
  22                  'name' => array('type' => 'varchar','precision' => '80','nullable' => False,'default' => ''),
  23                  'lang' => array('type' => 'varchar','precision' => '5','nullable' => False,'default' => ''),
  24                  'version' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '1'),
  25                  'time' => array('type' => 'int','precision' => '4'),
  26                  'supercede' => array('type' => 'int','precision' => '4'),
  27                  'readable' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
  28                  'writable' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
  29                  'username' => array('type' => 'varchar','precision' => '80'),
  30                  'hostname' => array('type' => 'varchar','precision' => '80','nullable' => False,'default' => ''),
  31                  'comment' => array('type' => 'varchar','precision' => '80','nullable' => False,'default' => ''),
  32                  'title' => array('type' => 'varchar','precision' => '80'),
  33                  'body' => array('type' => 'text'),
  34              ),
  35              'pk' => array('wiki_id','name','lang','version'),
  36              'fk' => array(),
  37              'ix' => array('title',array('body', 'options' => array('mysql' => 'FULLTEXT'))),
  38              'uc' => array()
  39          ),array(
  40              'name' => 'title',        // new name column with same content as the title
  41              'writable' => "CASE WHEN mutable != 'on' THEN -2 ELSE 0 END",    // migrate mutable to new acl
  42              'hostname' => 'author',    // rename column
  43          ));
  44  
  45          $GLOBALS['setup_info']['wiki']['currentver'] = '0.9.15.002';
  46          return $GLOBALS['setup_info']['wiki']['currentver'];
  47      }
  48  
  49  
  50      $test[] = '0.9.15.002';
  51  	function wiki_upgrade0_9_15_002()
  52      {
  53          $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_wiki_links',array(
  54              'fd' => array(
  55                  'wiki_id' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '0'),
  56                  'page' => array('type' => 'varchar','precision' => '80','nullable' => False,'default' => ''),
  57                  'lang' => array('type' => 'varchar','precision' => '5','nullable' => False,'default' => ''),
  58                  'link' => array('type' => 'varchar','precision' => '80','nullable' => False,'default' => ''),
  59                  'count' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0')
  60              ),
  61              'pk' => array('wiki_id','page','lang','link'),
  62              'fk' => array(),
  63              'ix' => array(),
  64              'uc' => array()
  65          ));
  66  
  67          $GLOBALS['setup_info']['wiki']['currentver'] = '0.9.15.003';
  68          return $GLOBALS['setup_info']['wiki']['currentver'];
  69      }
  70  
  71  
  72      $test[] = '0.9.15.003';
  73  	function wiki_upgrade0_9_15_003()
  74      {
  75          $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_wiki_interwiki',array(
  76              'fd' => array(
  77                  'wiki_id' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
  78                  'prefix' => array('type' => 'varchar','precision' => '80','nullable' => False,'default' => ''),
  79                  'where_defined_page' => array('type' => 'varchar','precision' => '80','nullable' => False,'default' => ''),
  80                  'where_defined_lang' => array('type' => 'varchar','precision' => '5','nullable' => False,'default' => ''),
  81                  'url' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '')
  82              ),
  83              'pk' => array('wiki_id','prefix'),
  84              'fk' => array(),
  85              'ix' => array(),
  86              'uc' => array()
  87          ),array(
  88              'where_defined_page' => 'where_defined'
  89          ));
  90  
  91          $GLOBALS['setup_info']['wiki']['currentver'] = '0.9.15.004';
  92          return $GLOBALS['setup_info']['wiki']['currentver'];
  93      }
  94  
  95  
  96      $test[] = '0.9.15.004';
  97  	function wiki_upgrade0_9_15_004()
  98      {
  99          $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_wiki_sisterwiki',array(
 100              'fd' => array(
 101                  'wiki_id' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
 102                  'prefix' => array('type' => 'varchar','precision' => '80','nullable' => False,'default' => ''),
 103                  'where_defined_page' => array('type' => 'varchar','precision' => '80','nullable' => False,'default' => ''),
 104                  'where_defined_lang' => array('type' => 'varchar','precision' => '5','nullable' => False,'default' => ''),
 105                  'url' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '')
 106              ),
 107              'pk' => array('wiki_id','prefix'),
 108              'fk' => array(),
 109              'ix' => array(),
 110              'uc' => array()
 111          ),array(
 112              'where_defined_page' => 'where_defined'
 113          ));
 114  
 115          $GLOBALS['setup_info']['wiki']['currentver'] = '0.9.15.005';
 116          return $GLOBALS['setup_info']['wiki']['currentver'];
 117      }
 118  
 119  
 120      $test[] = '0.9.15.005';
 121  	function wiki_upgrade0_9_15_005()
 122      {
 123          $GLOBALS['setup_info']['wiki']['currentver'] = '1.0.0';
 124          return $GLOBALS['setup_info']['wiki']['currentver'];
 125      }
 126  
 127  
 128      $test[] = '1.0.0';
 129  	function wiki_upgrade1_0_0()
 130      {
 131          // drop the index on the page-content, as it limites the content to 2700 chars
 132          if ($GLOBALS['egw_setup']->oProc->sType == 'pgsql')
 133          {
 134              $GLOBALS['egw_setup']->oProc->DropIndex('phpgw_wiki_pages',array('body'));
 135          }
 136          $GLOBALS['setup_info']['wiki']['currentver'] = '1.0.0.001';
 137          return $GLOBALS['setup_info']['wiki']['currentver'];
 138      }
 139  
 140  
 141      $test[] = '1.0.0.001';
 142  	function wiki_upgrade1_0_0_001()
 143      {
 144          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_links','page','wiki_name');
 145          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_links','lang','wiki_lang');
 146          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_links','link','wiki_link');
 147          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_links','count','wiki_count');
 148  
 149          $GLOBALS['setup_info']['wiki']['currentver'] = '1.0.0.002';
 150          return $GLOBALS['setup_info']['wiki']['currentver'];
 151      }
 152  
 153  
 154      $test[] = '1.0.0.002';
 155  	function wiki_upgrade1_0_0_002()
 156      {
 157          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_pages','name','wiki_name');
 158          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_pages','lang','wiki_lang');
 159          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_pages','version','wiki_version');
 160          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_pages','time','wiki_time');
 161          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_pages','supercede','wiki_supercede');
 162          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_pages','readable','wiki_readable');
 163          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_pages','writable','wiki_writable');
 164          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_pages','username','wiki_username');
 165          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_pages','hostname','wiki_hostname');
 166          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_pages','comment','wiki_comment');
 167          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_pages','title','wiki_title');
 168          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_pages','body','wiki_body');
 169          // deleted wiki-pages are now marked as NULL, not longer just as '', as MaxDB cant compare the LONG column agains ''
 170          $GLOBALS['egw_setup']->oProc->query("UPDATE phpgw_wiki_pages SET wiki_body=NULL WHERE wiki_body LIKE ''",__LINE__,__FILE__);
 171  
 172          $GLOBALS['setup_info']['wiki']['currentver'] = '1.0.0.003';
 173          return $GLOBALS['setup_info']['wiki']['currentver'];
 174      }
 175  
 176  
 177      $test[] = '1.0.0.003';
 178  	function wiki_upgrade1_0_0_003()
 179      {
 180          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_rate','ip','wiki_rate_ip');
 181          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_rate','time','wiki_rate_time');
 182          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_rate','viewLimit','wiki_rate_viewLimit');
 183          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_rate','searchLimit','wiki_rate_searchLimit');
 184          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_rate','editLimit','wiki_rate_editLimit');
 185  
 186          $GLOBALS['setup_info']['wiki']['currentver'] = '1.0.0.004';
 187          return $GLOBALS['setup_info']['wiki']['currentver'];
 188      }
 189  
 190  
 191      $test[] = '1.0.0.004';
 192  	function wiki_upgrade1_0_0_004()
 193      {
 194          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_interwiki','prefix','interwiki_prefix');
 195          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_interwiki','where_defined_page','wiki_name');
 196          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_interwiki','where_defined_lang','wiki_lang');
 197          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_interwiki','url','interwiki_url');
 198  
 199          $GLOBALS['setup_info']['wiki']['currentver'] = '1.0.0.005';
 200          return $GLOBALS['setup_info']['wiki']['currentver'];
 201      }
 202  
 203  
 204      $test[] = '1.0.0.005';
 205  	function wiki_upgrade1_0_0_005()
 206      {
 207          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_sisterwiki','prefix','sisterwiki_prefix');
 208          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_sisterwiki','where_defined_page','wiki_name');
 209          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_sisterwiki','where_defined_lang','wiki_lang');
 210          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_sisterwiki','url','sisterwiki_url');
 211  
 212          $GLOBALS['setup_info']['wiki']['currentver'] = '1.0.0.006';
 213          return $GLOBALS['setup_info']['wiki']['currentver'];
 214      }
 215  
 216  
 217      $test[] = '1.0.0.006';
 218  	function wiki_upgrade1_0_0_006()
 219      {
 220          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_remote_pages','page','wiki_remote_page');
 221          $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_wiki_remote_pages','site','wiki_remote_site');
 222  
 223          $GLOBALS['setup_info']['wiki']['currentver'] = '1.0.0.007';
 224          return $GLOBALS['setup_info']['wiki']['currentver'];
 225      }
 226  
 227  
 228      $test[] = '1.0.0.007';
 229  	function wiki_upgrade1_0_0_007()
 230      {
 231          $GLOBALS['egw_setup']->oProc->RenameTable('phpgw_wiki_links','egw_wiki_links');
 232          $GLOBALS['egw_setup']->oProc->RenameTable('phpgw_wiki_pages','egw_wiki_pages');
 233          $GLOBALS['egw_setup']->oProc->RenameTable('phpgw_wiki_rate','egw_wiki_rate');
 234          $GLOBALS['egw_setup']->oProc->RenameTable('phpgw_wiki_interwiki','egw_wiki_interwiki');
 235          $GLOBALS['egw_setup']->oProc->RenameTable('phpgw_wiki_sisterwiki','egw_wiki_sisterwiki');
 236          $GLOBALS['egw_setup']->oProc->RenameTable('phpgw_wiki_remote_pages','egw_wiki_remote_pages');
 237  
 238          $GLOBALS['setup_info']['wiki']['currentver'] = '1.0.1.001';
 239          return $GLOBALS['setup_info']['wiki']['currentver'];
 240      }
 241  
 242  
 243      $test[] = '1.0.1.001';
 244  	function wiki_upgrade1_0_1_001()
 245      {
 246          $GLOBALS['setup_info']['wiki']['currentver'] = '1.2';
 247          return $GLOBALS['setup_info']['wiki']['currentver'];
 248      }
 249  ?>


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