[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: projects/setup tables_update.inc.php,1.18,1.19
From: |
Bettina Gille <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: projects/setup tables_update.inc.php,1.18,1.19 |
Date: |
Fri, 16 May 2003 18:50:52 -0400 |
Update of /cvsroot/phpgroupware/projects/setup
In directory subversions:/tmp/cvs-serv13902
Modified Files:
tables_update.inc.php
Log Message:
update globals
Index: tables_update.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/setup/tables_update.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** tables_update.inc.php 14 May 2002 22:11:10 -0000 1.18
--- tables_update.inc.php 16 May 2003 22:50:50 -0000 1.19
***************
*** 13,19 ****
function projects_table_exists($table)
{
! global $phpgw_setup,$all_tables,$DEBUG;
!
! $tablenames = $phpgw_setup->db->table_names();
while(list($key,$val) = @each($tablenames))
{
--- 13,17 ----
function projects_table_exists($table)
{
! $tablenames = $GLOBALS['phpgw_setup']->db->table_names();
while(list($key,$val) = @each($tablenames))
{
***************
*** 22,31 ****
if(in_array($table,$all_tables))
{
! if ($DEBUG) { echo '<br>' . $table . ' exists.'; }
return True;
}
else
{
! if ($DEBUG) { echo '<br>' . $table . ' does not
exist.'; }
return False;
}
--- 20,29 ----
if(in_array($table,$all_tables))
{
! if ($GLOBALS['DEBUG']) { echo '<br>' . $table . '
exists.'; }
return True;
}
else
{
! if ($GLOBALS['DEBUG']) { echo '<br>' . $table . ' does
not exist.'; }
return False;
}
***************
*** 34,55 ****
function projects_table_column($table,$column)
{
! global $phpgw_setup,$DEBUG;
!
! $phpgw_setup->db->HaltOnError = False;
! $phpgw_setup->db->query("SELECT COUNT($column) FROM $table");
! $phpgw_setup->db->next_record();
! if (!$phpgw_setup->db->f(0))
{
! if ($DEBUG) { echo '<br>' . $table . ' has no column
named ' . $column; }
return False;
}
! if ($DEBUG) { echo '<br>' . $table . ' has a column named ' .
$column; }
return True;
}
! if ($setup_info['projects']['currentver'] == '')
{
! $setup_info['projects']['currentver'] == '0.0.0';
}
--- 32,51 ----
function projects_table_column($table,$column)
{
! $GLOBALS['phpgw_setup']->db->HaltOnError = False;
! $GLOBALS['phpgw_setup']->db->query("SELECT COUNT($column) FROM
$table");
! $GLOBALS['phpgw_setup']->db->next_record();
! if (!$GLOBALS['phpgw_setup']->db->f(0))
{
! if ($GLOBALS['DEBUG']) { echo '<br>' . $table . ' has
no column named ' . $column; }
return False;
}
! if ($GLOBALS['DEBUG']) { echo '<br>' . $table . ' has a column
named ' . $column; }
return True;
}
! if ($GLOBALS['setup_info']['projects']['currentver'] == '')
{
! $GLOBALS['setup_info']['projects']['currentver'] == '0.0.0';
}
***************
*** 57,64 ****
function projects_upgrade0_0()
{
! global $setup_info;
!
! $setup_info['projects']['currentver'] == '0.0.0';
! return $setup_info['projects']['currentver'];
}
--- 53,58 ----
function projects_upgrade0_0()
{
! $GLOBALS['setup_info']['projects']['currentver'] == '0.0.0';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 66,73 ****
function projects_upgrade0_8_2()
{
! global $setup_info;
!
! $setup_info['projects']['currentver'] == '0.0.0';
! return $setup_info['projects']['currentver'];
}
--- 60,65 ----
function projects_upgrade0_8_2()
{
! $GLOBALS['setup_info']['projects']['currentver'] == '0.0.0';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 115,124 ****
function projects_upgrade0_8_3()
{
! global $setup_info, $phpgw_setup;
!
! $phpgw_setup->oProc->DropTable('p_projectaddress');
! $setup_info['projects']['currentver'] = '0.8.3.001';
! return $setup_info['projects']['currentver'];
}
--- 107,114 ----
function projects_upgrade0_8_3()
{
! $GLOBALS['phpgw_setup']->oProc->DropTable('p_projectaddress');
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.3.001';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 126,135 ****
function projects_upgrade0_8_3_001()
{
! global $setup_info,$phpgw_setup;
! $phpgw_setup->oProc->AlterColumn('p_projects','access',array('type'
=> 'varchar','precision' => 25,'nullable' => True));
!
! $setup_info['projects']['currentver'] = '0.8.3.002';
! return $setup_info['projects']['currentver'];
}
--- 116,123 ----
function projects_upgrade0_8_3_001()
{
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('p_projects','access',array('type'
=> 'varchar','precision' => 25,'nullable' => True));
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.3.002';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 137,147 ****
function projects_upgrade0_8_3_002()
{
! global $setup_info,$phpgw_setup;
!
!
$phpgw_setup->oProc->AlterColumn('p_invoicepos','invoice_id',array('type' =>
'int','precision' => 4,'nullable' => False));
!
$phpgw_setup->oProc->AlterColumn('p_deliverypos','delivery_id',array('type' =>
'int','precision' => 4,'nullable' => False));
! $setup_info['projects']['currentver'] = '0.8.3.003';
! return $setup_info['projects']['currentver'];
}
--- 125,133 ----
function projects_upgrade0_8_3_002()
{
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('p_invoicepos','invoice_id',array('type'
=> 'int','precision' => 4,'nullable' => False));
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('p_deliverypos','delivery_id',array('type'
=> 'int','precision' => 4,'nullable' => False));
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.3.003';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 149,154 ****
function projects_upgrade0_8_3_003()
{
- global $setup_info,$phpgw_setup;
-
$newtabledefinition = array(
'fd' => array(
--- 135,138 ----
***************
*** 172,206 ****
);
!
$phpgw_setup->oProc->RenameTable('p_projects','phpgw_p_projects');
!
$phpgw_setup->oProc->RenameColumn('phpgw_p_projects','date','start_date');
!
$phpgw_setup->oProc->AlterColumn('phpgw_p_projects','start_date',array('type'
=> 'int','precision' => 4,'default' => 0,'nullable' => False));
!
$phpgw_setup->oProc->AlterColumn('phpgw_p_projects','title',array('type' =>
'varchar','precision' => 255,'nullable' => False));
!
$phpgw_setup->oProc->AlterColumn('phpgw_p_projects','num',array('type' =>
'varchar','precision' => 20,'nullable' => False));
!
$phpgw_setup->oProc->DropColumn('phpgw_p_projects',$newtabledefinition,'access');
! $phpgw_setup->oProc->query("CREATE INDEX phpgw_p_projects_key
ON phpgw_p_projects(id,num)");
!
!
$phpgw_setup->oProc->RenameTable('p_activities','phpgw_p_activities');
!
$phpgw_setup->oProc->AlterColumn('phpgw_p_activities','descr',array('type' =>
'varchar','precision' => 255,'nullable' => False));
!
$phpgw_setup->oProc->AlterColumn('phpgw_p_activities','num',array('type' =>
'varchar','precision' => 20,'nullable' => False));
! $phpgw_setup->oProc->query("CREATE INDEX phpgw_p_activities_key
ON phpgw_p_activities(id,num)");
!
!
$phpgw_setup->oProc->RenameTable('p_projectactivities','phpgw_p_projectactivities');
! $phpgw_setup->oProc->RenameTable('p_hours','phpgw_p_hours');
!
$phpgw_setup->oProc->RenameTable('p_projectmembers','phpgw_p_projectmembers');
!
! $phpgw_setup->oProc->RenameTable('p_invoice','phpgw_p_invoice');
!
$phpgw_setup->oProc->AlterColumn('phpgw_p_invoice','num',array('type' =>
'varchar','precision' => 20,'nullable' => False));
! $phpgw_setup->oProc->query("CREATE INDEX phpgw_p_invoice_key ON
phpgw_p_invoice(id,num)");
!
!
$phpgw_setup->oProc->RenameTable('p_invoicepos','phpgw_p_invoicepos');
!
!
$phpgw_setup->oProc->RenameTable('p_delivery','phpgw_p_delivery');
!
$phpgw_setup->oProc->AlterColumn('phpgw_p_delivery','num',array('type' =>
'varchar','precision' => 20,'nullable' => False));
! $phpgw_setup->oProc->query("CREATE INDEX phpgw_p_delivery_key
ON phpgw_p_delivery(id,num)");
!
$phpgw_setup->oProc->RenameTable('p_deliverypos','phpgw_p_deliverypos');
! $setup_info['projects']['currentver'] = '0.8.4';
! return $setup_info['projects']['currentver'];
}
--- 156,190 ----
);
!
$GLOBALS['phpgw_setup']->oProc->RenameTable('p_projects','phpgw_p_projects');
!
$GLOBALS['phpgw_setup']->oProc->RenameColumn('phpgw_p_projects','date','start_date');
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_p_projects','start_date',array('type'
=> 'int','precision' => 4,'default' => 0,'nullable' => False));
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_p_projects','title',array('type'
=> 'varchar','precision' => 255,'nullable' => False));
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_p_projects','num',array('type'
=> 'varchar','precision' => 20,'nullable' => False));
!
$GLOBALS['phpgw_setup']->oProc->DropColumn('phpgw_p_projects',$newtabledefinition,'access');
! $GLOBALS['phpgw_setup']->oProc->query("CREATE INDEX
phpgw_p_projects_key ON phpgw_p_projects(id,num)");
!
!
$GLOBALS['phpgw_setup']->oProc->RenameTable('p_activities','phpgw_p_activities');
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_p_activities','descr',array('type'
=> 'varchar','precision' => 255,'nullable' => False));
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_p_activities','num',array('type'
=> 'varchar','precision' => 20,'nullable' => False));
! $GLOBALS['phpgw_setup']->oProc->query("CREATE INDEX
phpgw_p_activities_key ON phpgw_p_activities(id,num)");
!
!
$GLOBALS['phpgw_setup']->oProc->RenameTable('p_projectactivities','phpgw_p_projectactivities');
!
$GLOBALS['phpgw_setup']->oProc->RenameTable('p_hours','phpgw_p_hours');
!
$GLOBALS['phpgw_setup']->oProc->RenameTable('p_projectmembers','phpgw_p_projectmembers');
!
!
$GLOBALS['phpgw_setup']->oProc->RenameTable('p_invoice','phpgw_p_invoice');
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_p_invoice','num',array('type'
=> 'varchar','precision' => 20,'nullable' => False));
! $GLOBALS['phpgw_setup']->oProc->query("CREATE INDEX
phpgw_p_invoice_key ON phpgw_p_invoice(id,num)");
!
!
$GLOBALS['phpgw_setup']->oProc->RenameTable('p_invoicepos','phpgw_p_invoicepos');
!
!
$GLOBALS['phpgw_setup']->oProc->RenameTable('p_delivery','phpgw_p_delivery');
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_p_delivery','num',array('type'
=> 'varchar','precision' => 20,'nullable' => False));
! $GLOBALS['phpgw_setup']->oProc->query("CREATE INDEX
phpgw_p_delivery_key ON phpgw_p_delivery(id,num)");
!
$GLOBALS['phpgw_setup']->oProc->RenameTable('p_deliverypos','phpgw_p_deliverypos');
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.4';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 208,218 ****
function projects_upgrade0_8_4()
{
! global $setup_info,$phpgw_setup;
!
$phpgw_setup->oProc->RenameColumn('phpgw_p_hours','date','start_date');
!
$phpgw_setup->oProc->AlterColumn('phpgw_p_hours','start_date',array('type' =>
'int','precision' => 4,'default' => 0,'nullable' => False));
!
! $setup_info['projects']['currentver'] = '0.8.4.001';
! return $setup_info['projects']['currentver'];
}
--- 192,200 ----
function projects_upgrade0_8_4()
{
!
$GLOBALS['phpgw_setup']->oProc->RenameColumn('phpgw_p_hours','date','start_date');
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_p_hours','start_date',array('type'
=> 'int','precision' => 4,'default' => 0,'nullable' => False));
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.4.001';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 220,229 ****
function projects_upgrade0_8_4_001()
{
! global $setup_info,$phpgw_setup;
!
!
$phpgw_setup->oProc->AddColumn('phpgw_p_hours','hours_descr',array('type' =>
'varchar','precision' => 255,'nullable' => False));
! $setup_info['projects']['currentver'] = '0.8.4.002';
! return $setup_info['projects']['currentver'];
}
--- 202,209 ----
function projects_upgrade0_8_4_001()
{
!
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_p_hours','hours_descr',array('type'
=> 'varchar','precision' => 255,'nullable' => False));
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.4.002';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 231,242 ****
function projects_upgrade0_8_4_002()
{
! global $setup_info,$phpgw_setup;
!
$phpgw_setup->oProc->AddColumn('phpgw_p_projects','access',array('type' =>
'varchar','precision' => 7,'nullable' => True));
!
$phpgw_setup->oProc->AddColumn('phpgw_p_projects','category',array('type' =>
'int','precision' => 4,'default' => 0,'nullable' => False));
!
$phpgw_setup->oProc->AlterColumn('phpgw_p_projects','status',array('type' =>
'varchar','precision' => 9,'default' => 'active','nullable' => False));
!
! $setup_info['projects']['currentver'] = '0.8.4.003';
! return $setup_info['projects']['currentver'];
}
--- 211,220 ----
function projects_upgrade0_8_4_002()
{
!
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_p_projects','access',array('type'
=> 'varchar','precision' => 7,'nullable' => True));
!
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_p_projects','category',array('type'
=> 'int','precision' => 4,'default' => 0,'nullable' => False));
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_p_projects','status',array('type'
=> 'varchar','precision' => 9,'default' => 'active','nullable' => False));
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.4.003';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 244,253 ****
function projects_upgrade0_8_4_003()
{
! global $setup_info,$phpgw_setup;
!
!
$phpgw_setup->oProc->AddColumn('phpgw_p_projectmembers','type',array('type' =>
'char','precision' => 2,'nullable' => False));
! $setup_info['projects']['currentver'] = '0.8.4.004';
! return $setup_info['projects']['currentver'];
}
--- 222,229 ----
function projects_upgrade0_8_4_003()
{
!
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_p_projectmembers','type',array('type'
=> 'char','precision' => 2,'nullable' => False));
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.4.004';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 255,265 ****
function projects_upgrade0_8_4_004()
{
! global $setup_info,$phpgw_setup;
!
!
$phpgw_setup->oProc->AlterColumn('phpgw_p_activities','remarkreq',array('type'
=> 'char','precision' => 1,'default' => 'N','nullable' => False));
!
$phpgw_setup->oProc->AlterColumn('phpgw_p_projectactivities','billable',array('type'
=> 'char','precision' => 1,'default' => 'N','nullable' => False));
! $setup_info['projects']['currentver'] = '0.8.4.005';
! return $setup_info['projects']['currentver'];
}
--- 231,239 ----
function projects_upgrade0_8_4_004()
{
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_p_activities','remarkreq',array('type'
=> 'char','precision' => 1,'default' => 'N','nullable' => False));
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_p_projectactivities','billable',array('type'
=> 'char','precision' => 1,'default' => 'N','nullable' => False));
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.4.005';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 267,274 ****
function projects_upgrade0_8_4_005()
{
! global $setup_info;
!
! $setup_info['projects']['currentver'] = '0.8.4.006';
! return $setup_info['projects']['currentver'];
}
--- 241,246 ----
function projects_upgrade0_8_4_005()
{
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.4.006';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 276,287 ****
function projects_upgrade0_8_4_006()
{
! global $setup_info,$phpgw_setup;
!
! $phpgw_setup->oProc->query("CREATE UNIQUE INDEX project_num ON
phpgw_p_projects(num)");
! $phpgw_setup->oProc->query("CREATE UNIQUE INDEX invoice_num ON
phpgw_p_invoice(num)");
! $phpgw_setup->oProc->query("CREATE UNIQUE INDEX delivery_num ON
phpgw_p_delivery(num)");
! $setup_info['projects']['currentver'] = '0.8.5.001';
! return $setup_info['projects']['currentver'];
}
--- 248,257 ----
function projects_upgrade0_8_4_006()
{
! $GLOBALS['phpgw_setup']->oProc->query("CREATE UNIQUE INDEX
project_num ON phpgw_p_projects(num)");
! $GLOBALS['phpgw_setup']->oProc->query("CREATE UNIQUE INDEX
invoice_num ON phpgw_p_invoice(num)");
! $GLOBALS['phpgw_setup']->oProc->query("CREATE UNIQUE INDEX
delivery_num ON phpgw_p_delivery(num)");
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.5.001';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 289,298 ****
function projects_upgrade0_8_5_001()
{
! global $setup_info,$phpgw_setup;
!
$phpgw_setup->oProc->AlterColumn('phpgw_p_hours','status',array('type' =>
'varchar','precision' => 6,'default' => 'done','nullable' => False));
!
! $setup_info['projects']['currentver'] = '0.8.5.002';
! return $setup_info['projects']['currentver'];
}
--- 259,266 ----
function projects_upgrade0_8_5_001()
{
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_p_hours','status',array('type'
=> 'varchar','precision' => 6,'default' => 'done','nullable' => False));
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.5.002';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 300,309 ****
function projects_upgrade0_8_5_002()
{
! global $setup_info,$phpgw_setup;
!
!
$phpgw_setup->oProc->AddColumn('phpgw_p_hours','dstatus',array('type' =>
'char','precision' => 1,'default' => 'o','nullable' => False));
! $setup_info['projects']['currentver'] = '0.8.5.003';
! return $setup_info['projects']['currentver'];
}
--- 268,275 ----
function projects_upgrade0_8_5_002()
{
!
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_p_hours','dstatus',array('type'
=> 'char','precision' => 1,'default' => 'o','nullable' => False));
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.5.003';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 311,320 ****
function projects_upgrade0_8_5_003()
{
! global $setup_info,$phpgw_setup;
!
!
$phpgw_setup->oProc->AddColumn('phpgw_p_projects','parent',array('type' =>
'int','precision' => 4,'default' => 0,'nullable' => False));
! $setup_info['projects']['currentver'] = '0.8.5.004';
! return $setup_info['projects']['currentver'];
}
--- 277,284 ----
function projects_upgrade0_8_5_003()
{
!
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_p_projects','parent',array('type'
=> 'int','precision' => 4,'default' => 0,'nullable' => False));
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.5.004';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 322,331 ****
function projects_upgrade0_8_5_004()
{
! global $setup_info,$phpgw_setup;
!
$phpgw_setup->oProc->AddColumn('phpgw_p_activities','category',array('type' =>
'int','precision' => 4,'default' => 0,'nullable' => False));
!
! $setup_info['projects']['currentver'] = '0.8.5.005';
! return $setup_info['projects']['currentver'];
}
--- 286,293 ----
function projects_upgrade0_8_5_004()
{
!
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_p_activities','category',array('type'
=> 'int','precision' => 4,'default' => 0,'nullable' => False));
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.5.005';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
***************
*** 333,342 ****
function projects_upgrade0_8_5_005()
{
! global $setup_info,$phpgw_setup;
!
!
$phpgw_setup->oProc->AlterColumn('phpgw_p_projects','num',array('type' =>
'varchar','precision' => 25,'nullable' => False));
! $setup_info['projects']['currentver'] = '0.8.5.006';
! return $setup_info['projects']['currentver'];
}
--- 295,302 ----
function projects_upgrade0_8_5_005()
{
!
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_p_projects','num',array('type'
=> 'varchar','precision' => 25,'nullable' => False));
! $GLOBALS['setup_info']['projects']['currentver'] = '0.8.5.006';
! return $GLOBALS['setup_info']['projects']['currentver'];
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: projects/setup tables_update.inc.php,1.18,1.19,
Bettina Gille <address@hidden> <=