blob: 00734f250061cb903e6128c3dcac167db6e23b5d [file] [log] [blame]
<?php
require_once "/home/data/httpd/eclipse-php-classes/system/dbconnection_dashboard_rw.class.php";
require_once "hostname.php";
$db_connection = new DBConnectionDashboard();
$db_handle = $db_connection->connect();
$new_column = array('bugs_total',
'bugs_7_delta',
'bugs_7_percentage',
'bugs_7_gainloss',
'bugs_30_delta',
'bugs_30_percentage',
'bugs_30_gainloss',
'bugs_180_delta',
'bugs_180_percentage',
'bugs_180_gainloss');
$old_column = array('dashboard_number_bugs',
'dashboard_7_delta',
'dashboard_7_percentage',
'dashboard_7_gainloss',
'dashboard_30_delta',
'dashboard_30_percentage',
'dashboard_30_gainloss',
'dashboard_180_delta',
'dashboard_180_percentage',
'dashboard_180_gainloss');
$data_type = array('smallint',
'smallint',
'tinyint',
'smallint',
'smallint',
'tinyint',
'smallint',
'smallint',
'tinyint',
'smallint');
for($i=0;$i<count($old_column);$i++){
$query = "ALTER TABLE ".stats_table()." CHANGE COLUMN ".$old_column[$i]." ".$new_column[$i]." ".$data_type[$i];
echo $query."<br>";
mysql_query($query,$db_handle) or die("Could not alter table: ".mysql_error());
}
$db_handle = null;
$db_connection = null;
?>