source: trunk/calendar/setup/tables_update.inc.php @ 1835

Revision 1835, 3.0 KB checked in by niltonneto, 11 years ago (diff)

Ticket #802 - Corrigido rotina de atualização dos módulos.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2  /**************************************************************************\
3  * eGroupWare - Setup                                                       *
4  * http://www.egroupware.org                                                *
5  * --------------------------------------------                             *
6  *  This program is free software; you can redistribute it and/or modify it *
7  *  under the terms of the GNU General Public License as published by the   *
8  *  Free Software Foundation; either version 2 of the License, or (at your  *
9  *  option) any later version.                                              *
10  \**************************************************************************/
11        function addSpecialColumn($table,$column, $attrs){
12                $result = $GLOBALS['phpgw_setup']->db->metadata($table);
13                if($result){
14                        foreach($result as $idx => $col){
15                                if($col['name'] == $column)
16                                        return;
17                        }
18                }               
19                $GLOBALS['phpgw_setup']->db->query("ALTER TABLE ".$table." ADD COLUMN ".$column." ".$attrs);
20        } 
21        $test[] = '0.9.2';
22        function calendar_upgrade0_9_2()
23        {
24                $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.17';
25                return $GLOBALS['setup_info']['calendar']['currentver'];
26        }
27        $test[] = '0.9.17';
28        function calendar_upgrade0_9_17()
29        {
30                $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.21';
31                return $GLOBALS['setup_info']['calendar']['currentver'];
32        }
33        $test[] = '0.9.20';
34        function calendar_upgrade0_9_20()
35        {
36                $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.21';
37                return $GLOBALS['setup_info']['calendar']['currentver'];
38        }       
39        $test[] = '0.9.21';
40        function calendar_upgrade0_9_21()
41        {
42                addSpecialColumn("phpgw_cal","last_status","char(1) DEFAULT 'N'::bpchar");
43                addSpecialColumn("phpgw_cal","last_update","int8 DEFAULT (date_part('epoch'::text, ('now'::text)::timestamp(3) with time zone) * (1000)::double precision)");
44                $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.22';
45                return $GLOBALS['setup_info']['calendar']['currentver'];
46        }       
47        $test[] = '0.9.22';
48        function calendar_upgrade0_9_22()
49        {
50                $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.23';
51                return $GLOBALS['setup_info']['calendar']['currentver'];
52        }
53        $test[] = '0.9.23';
54        function calendar_upgrade0_9_23()
55        {
56                $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.3';
57                return $GLOBALS['setup_info']['calendar']['currentver'];
58        }       
59        $test[] = '0.9.3';
60        function calendar_upgrade0_9_3()
61        {
62                $GLOBALS['setup_info']['calendar']['currentver'] = '2.0.000';
63                return $GLOBALS['setup_info']['calendar']['currentver'];
64        }
65        $test[] = '2.0.000';
66        function calendar_upgrade2_0_000()
67        {
68                $GLOBALS['setup_info']['calendar']['currentver'] = '2.0.001';
69                return $GLOBALS['setup_info']['calendar']['currentver'];
70        }
71        $test[] = '2.0.001';
72        function calendar_upgrade2_0_001()
73        {
74                $GLOBALS['setup_info']['calendar']['currentver'] = '2.0.002';
75                return $GLOBALS['setup_info']['calendar']['currentver'];
76        }
77        $test[] = '2.0.002';
78        function calendar_upgrade2_0_002()
79        {
80                $GLOBALS['setup_info']['calendar']['currentver'] = '2.1.000';
81                return $GLOBALS['setup_info']['calendar']['currentver'];
82        }
83?>
Note: See TracBrowser for help on using the repository browser.