View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005289 | mantisbt | sql | public | 2005-02-28 04:21 | 2007-05-08 03:44 |
Reporter | grangeway | Assigned To | grangeway | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Fixed in Version | 1.0.0 | ||||
Summary | 0005289: Use ADODB DataDict for DB Creation / Upgrade | ||||
Description | ADODB contains a datadict. We should make a schema available via it instead of individual mssql.sql, mysql.sql,pgsql.sql files etc. This could then form part of a new installer / upgrade routine. | ||||
Tags | No tags attached. | ||||
Attached Files | schema.php.txt (14,890 bytes)
<? $upgrade[] = Array(1,'CreateTableSQL',Array($g_mantis_bug_file_table," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, bug_id I UNSIGNED NOTNULL DEFAULT '0', title C(250) NOTNULL DEFAULT \" '' \", description C(250) NOTNULL DEFAULT \" '' \", diskfile C(250) NOTNULL DEFAULT \" '' \", filename C(250) NOTNULL DEFAULT \" '' \", folder C(250) NOTNULL DEFAULT \" '' \", filesize I NOTNULL DEFAULT '0', file_type C(250) NOTNULL DEFAULT \" '' \", date_added T NOTNULL DEFAULT '1970-01-01 00:00:01', content B NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(2,'CreateTableSQL',Array($g_mantis_bug_history_table," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, user_id I UNSIGNED NOTNULL DEFAULT '0', bug_id I UNSIGNED NOTNULL DEFAULT '0', date_modified T NOTNULL DEFAULT '1970-01-01 00:00:01', field_name C(32) NOTNULL DEFAULT \" '' \", old_value C(128) NOTNULL DEFAULT \" '' \", new_value C(128) NOTNULL DEFAULT \" '' \", type I2 NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(3,'CreateTableSQL',Array($g_mantis_bug_monitor_table," user_id I UNSIGNED NOTNULL PRIMARY DEFAULT '0', bug_id I UNSIGNED NOTNULL PRIMARY DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(4,'CreateTableSQL',Array($g_mantis_bug_relationship_table," id I UNSIGNED NOTNULL AUTOINCREMENT PRIMARY, source_bug_id I UNSIGNED NOTNULL DEFAULT '0', destination_bug_id I UNSIGNED NOTNULL DEFAULT '0', relationship_type I2 NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(5,'CreateTableSQL',Array($g_mantis_bug_table," id I UNSIGNED PRIMARY NOTNULL AUTOINCREMENT, project_id I UNSIGNED NOTNULL DEFAULT '0', reporter_id I UNSIGNED NOTNULL DEFAULT '0', handler_id I UNSIGNED NOTNULL DEFAULT '0', duplicate_id I UNSIGNED NOTNULL DEFAULT '0', priority I2 NOTNULL DEFAULT '30', severity I2 NOTNULL DEFAULT '50', reproducibility I2 NOTNULL DEFAULT '10', status I2 NOTNULL DEFAULT '10', resolution I2 NOTNULL DEFAULT '10', projection I2 NOTNULL DEFAULT '10', category C(64) NOTNULL DEFAULT \" '' \", date_submitted T NOTNULL DEFAULT '1970-01-01 00:00:01', last_updated T NOTNULL DEFAULT '1970-01-01 00:00:01', eta I2 NOTNULL DEFAULT '10', bug_text_id I UNSIGNED NOTNULL DEFAULT '0', os C(32) NOTNULL DEFAULT \" '' \", os_build C(32) NOTNULL DEFAULT \" '' \", platform C(32) NOTNULL DEFAULT \" '' \", version C(64) NOTNULL DEFAULT \" '' \", fixed_in_version C(64) NOTNULL DEFAULT \" '' \", build C(32) NOTNULL DEFAULT \" '' \", profile_id I UNSIGNED NOTNULL DEFAULT '0', view_state I2 NOTNULL DEFAULT '10', summary C(128) NOTNULL DEFAULT \" '' \", sponsorship_total I NOTNULL DEFAULT '0', sticky L NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(6,'CreateTableSQL',Array($g_mantis_bug_text_table," id I PRIMARY UNSIGNED NOTNULL AUTOINCREMENT, description XS NOTNULL, steps_to_reproduce XS NOTNULL, additional_information XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(7,'CreateTableSQL',Array($g_mantis_bugnote_table," id I UNSIGNED PRIMARY NOTNULL AUTOINCREMENT, bug_id I UNSIGNED NOTNULL DEFAULT '0', reporter_id I UNSIGNED NOTNULL DEFAULT '0', bugnote_text_id I UNSIGNED NOTNULL DEFAULT '0', view_state I2 NOTNULL DEFAULT '10', date_submitted T NOTNULL DEFAULT '1970-01-01 00:00:01', last_modified T NOTNULL DEFAULT '1970-01-01 00:00:01', note_type I DEFAULT '0', note_attr C(250) DEFAULT \" '' \" ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(8,'CreateTableSQL',Array($g_mantis_bugnote_text_table," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, note XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(9,'CreateTableSQL',Array($g_mantis_custom_field_project_table," field_id I NOTNULL PRIMARY DEFAULT '0', project_id I UNSIGNED PRIMARY NOTNULL DEFAULT '0', sequence I2 NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(10,'CreateTableSQL',Array($g_mantis_custom_field_string_table," field_id I NOTNULL PRIMARY DEFAULT '0', bug_id I NOTNULL PRIMARY DEFAULT '0', value C(255) NOTNULL DEFAULT \" '' \" ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(11,'CreateTableSQL',Array($g_mantis_custom_field_table," id I NOTNULL PRIMARY AUTOINCREMENT, name C(64) NOTNULL DEFAULT \" '' \", type I2 NOTNULL DEFAULT '0', possible_values C(255) NOTNULL DEFAULT \" '' \", default_value C(255) NOTNULL DEFAULT \" '' \", valid_regexp C(255) NOTNULL DEFAULT \" '' \", access_level_r I2 NOTNULL DEFAULT '0', access_level_rw I2 NOTNULL DEFAULT '0', length_min I NOTNULL DEFAULT '0', length_max I NOTNULL DEFAULT '0', advanced L NOTNULL DEFAULT '0', require_report L NOTNULL DEFAULT '0', require_update L NOTNULL DEFAULT '0', display_report L NOTNULL DEFAULT '1', display_update L NOTNULL DEFAULT '1', require_resolved L NOTNULL DEFAULT '0', display_resolved L NOTNULL DEFAULT '0', display_closed L NOTNULL DEFAULT '0', require_closed L NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(12,'CreateTableSQL',Array($g_mantis_filters_table," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, user_id I NOTNULL DEFAULT '0', project_id I NOTNULL DEFAULT '0', is_public L DEFAULT NULL, name C(64) NOTNULL DEFAULT \" '' \", filter_string XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(13,'CreateTableSQL',Array($g_mantis_news_table," id I UNSIGNED PRIMARY NOTNULL AUTOINCREMENT, project_id I UNSIGNED NOTNULL DEFAULT '0', poster_id I UNSIGNED NOTNULL DEFAULT '0', date_posted T NOTNULL DEFAULT '1970-01-01 00:00:01', last_modified T NOTNULL DEFAULT '1970-01-01 00:00:01', view_state I2 NOTNULL DEFAULT '10', announcement L NOTNULL DEFAULT '0', headline C(64) NOTNULL DEFAULT \" '' \", body XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(14,'CreateTableSQL',Array($g_mantis_project_category_table," project_id I UNSIGNED NOTNULL PRIMARY DEFAULT '0', category C(64) NOTNULL PRIMARY DEFAULT \" '' \", user_id I UNSIGNED NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(15,'CreateTableSQL',Array($g_mantis_project_file_table," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, project_id I UNSIGNED NOTNULL DEFAULT '0', title C(250) NOTNULL DEFAULT \" '' \", description C(250) NOTNULL DEFAULT \" '' \", diskfile C(250) NOTNULL DEFAULT \" '' \", filename C(250) NOTNULL DEFAULT \" '' \", folder C(250) NOTNULL DEFAULT \" '' \", filesize I NOTNULL DEFAULT '0', file_type C(250) NOTNULL DEFAULT \" '' \", date_added T NOTNULL DEFAULT '1970-01-01 00:00:01', content B NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(16,'CreateTableSQL',Array($g_mantis_project_table," id I UNSIGNED PRIMARY NOTNULL AUTOINCREMENT, name C(128) NOTNULL DEFAULT \" '' \", status I2 NOTNULL DEFAULT '10', enabled L NOTNULL DEFAULT '1', view_state I2 NOTNULL DEFAULT '10', access_min I2 NOTNULL DEFAULT '10', file_path C(250) NOTNULL DEFAULT \" '' \", description XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(17,'CreateTableSQL',Array($g_mantis_project_user_list_table," project_id I UNSIGNED PRIMARY NOTNULL DEFAULT '0', user_id I UNSIGNED PRIMARY NOTNULL DEFAULT '0', access_level I2 NOTNULL DEFAULT '10' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(18,'CreateTableSQL',Array($g_mantis_project_version_table," id I NOTNULL PRIMARY AUTOINCREMENT, project_id I UNSIGNED NOTNULL DEFAULT '0', version C(64) NOTNULL DEFAULT \" '' \", date_order T NOTNULL DEFAULT '1970-01-01 00:00:01', description XS NOTNULL, released L NOTNULL DEFAULT '1' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(19,'CreateTableSQL',Array($g_mantis_sponsorship_table," id I NOTNULL PRIMARY AUTOINCREMENT, bug_id I NOTNULL DEFAULT '0', user_id I NOTNULL DEFAULT '0', amount I NOTNULL DEFAULT '0', logo C(128) NOTNULL DEFAULT \" '' \", url C(128) NOTNULL DEFAULT \" '' \", paid L NOTNULL DEFAULT '0', date_submitted T NOTNULL DEFAULT '1970-01-01 00:00:01', last_updated T NOTNULL DEFAULT '1970-01-01 00:00:01' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(20,'CreateTableSQL',Array($g_mantis_database," schema_version int ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(21,'CreateTableSQL',Array($g_mantis_user_pref_table," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, user_id I UNSIGNED NOTNULL DEFAULT '0', project_id I UNSIGNED NOTNULL DEFAULT '0', default_profile I UNSIGNED NOTNULL DEFAULT '0', default_project I UNSIGNED NOTNULL DEFAULT '0', advanced_report L NOTNULL DEFAULT '0', advanced_view L NOTNULL DEFAULT '0', advanced_update L NOTNULL DEFAULT '0', refresh_delay I NOTNULL DEFAULT '0', redirect_delay L NOTNULL DEFAULT '0', bugnote_order C(4) NOTNULL DEFAULT 'ASC', email_on_new L NOTNULL DEFAULT '0', email_on_assigned L NOTNULL DEFAULT '0', email_on_feedback L NOTNULL DEFAULT '0', email_on_resolved L NOTNULL DEFAULT '0', email_on_closed L NOTNULL DEFAULT '0', email_on_reopened L NOTNULL DEFAULT '0', email_on_bugnote L NOTNULL DEFAULT '0', email_on_status L NOTNULL DEFAULT '0', email_on_priority L NOTNULL DEFAULT '0', email_on_priority_minimum_severity I2 NOTNULL DEFAULT '10', email_on_status_minimum_severity I2 NOTNULL DEFAULT '10', email_on_bugnote_minimum_severity I2 NOTNULL DEFAULT '10', email_on_reopened_minimum_severity I2 NOTNULL DEFAULT '10', email_on_closed_minimum_severity I2 NOTNULL DEFAULT '10', email_on_resolved_minimum_severity I2 NOTNULL DEFAULT '10', email_on_feedback_minimum_severity I2 NOTNULL DEFAULT '10', email_on_assigned_minimum_severity I2 NOTNULL DEFAULT '10', email_on_new_minimum_severity I2 NOTNULL DEFAULT '10', email_bugnote_limit I2 NOTNULL DEFAULT '0', language C(32) NOTNULL DEFAULT 'english' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(22,'CreateTableSQL',Array($g_mantis_user_print_pref_table," user_id I UNSIGNED NOTNULL PRIMARY DEFAULT '0', print_pref C(27) NOTNULL DEFAULT \" '' \" ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(23,'CreateTableSQL',Array($g_mantis_user_profile_table," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, user_id I UNSIGNED NOTNULL DEFAULT '0', platform C(32) NOTNULL DEFAULT \" '' \", os C(32) NOTNULL DEFAULT \" '' \", os_build C(32) NOTNULL DEFAULT \" '' \", description XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(24,'CreateTableSQL',Array($g_mantis_user_table," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, username C(32) NOTNULL DEFAULT \" '' \", realname C(64) NOTNULL DEFAULT \" '' \", email C(64) NOTNULL DEFAULT \" '' \", password C(32) NOTNULL DEFAULT \" '' \", date_created T NOTNULL DEFAULT '1970-01-01 00:00:01', last_visit T NOTNULL DEFAULT '1970-01-01 00:00:01', enabled L NOTNULL DEFAULT '1', protected L NOTNULL DEFAULT '0', access_level I2 NOTNULL DEFAULT '10', login_count I NOTNULL DEFAULT '0', lost_password_request_count I2 NOTNULL DEFAULT '0', failed_login_count I2 NOTNULL DEFAULT '0', cookie_string C(64) NOTNULL DEFAULT \" '' \" ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(25, 'CreateIndexSQL',Array('idx_bug_file_bug_id',$g_mantis_bug_file_table,'bug_id')); $upgrade[] = Array(26, 'CreateIndexSQL',Array('idx_bug_history_bug_id',$g_mantis_bug_history_table,'bug_id')); $upgrade[] = Array(27, 'CreateIndexSQL',Array('idx_user_cookie_string',$g_mantis_user_table,'cookie_string',Array('UNIQUE'))); $upgrade[] = Array(28, 'CreateIndexSQL',Array('idx_user_username',$g_mantis_user_table,'username',Array('UNIQUE'))); $upgrade[] = Array(29, 'CreateIndexSQL',Array('idx_project_id',$g_mantis_project_table,'id')); $upgrade[] = Array(30, 'CreateIndexSQL',Array('idx_project_name',$g_mantis_project_table,'name',Array('UNIQUE'))); $upgrade[] = Array(31, 'CreateIndexSQL',Array('idx_project_version_project_version',$g_mantis_project_version_table,'project_id,version',Array('UNIQUE'))); $upgrade[] = Array(32, 'CreateIndexSQL',Array('idx_history_user_id',$g_mantis_bug_history_table,'user_id')); $upgrade[] = Array(33, 'CreateIndexSQL',Array('idx_bug_relationship_source_bug_id',$g_mantis_bug_relationship_table,'source_bug_id')); $upgrade[] = Array(34, 'CreateIndexSQL',Array('idx_bug_relationship_destination_bug_id',$g_mantis_bug_relationship_table,'destination_bug_id')); $upgrade[] = Array(35, 'CreateIndexSQL',Array('idx_bug_sponsorship_total',$g_mantis_bug_table,'sponsorship_total')); $upgrade[] = Array(36, 'CreateIndexSQL',Array('idx_bug_fixed_in_version',$g_mantis_bug_table,'fixed_in_version')); $upgrade[] = Array(37, 'CreateIndexSQL',Array('idx_custom_field_name',$g_mantis_custom_field_table,'name')); $upgrade[] = Array(38, 'CreateIndexSQL',Array('idx_news_id',$g_mantis_news_table,'id')); $upgrade[] = Array(39, 'CreateIndexSQL',Array('idx_sponsorship_table_bug_id',$g_mantis_sponsorship_table,'bug_id')); $upgrade[] = Array(40, 'CreateIndexSQL',Array('idx_sponsorship_table_user_id',$g_mantis_sponsorship_table,'user_id')); $upgrade[] = Array(41,'CreateTableSQL',Array($g_mantis_tokens_table," id I NOTNULL PRIMARY AUTOINCREMENT, owner I NOTNULL, type I NOTNULL, timestamp T NOTNULL, expiry T, value XS NOTNULL", Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); ?> install.php.txt (9,394 bytes)
<?php # Mantis - a php based bugtracking system # Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org # Copyright (C) 2002 - 2004 Mantis Team - mantisbt-dev@lists.sourceforge.net # This program is distributed under the terms and conditions of the GPL # See the README and LICENSE files for details # -------------------------------------------------------- # $Id: check.php,v 1.6 2004/03/05 01:26:17 jlatour Exp $ # -------------------------------------------------------- ?> <?php error_reporting( E_ALL ); //@@@ put this somewhere set_time_limit ( 0 ) ; $g_skip_open_db = true; # don't open the database in database_api.php @require_once( '../core.php' ); define( 'BAD', 0 ); define( 'GOOD', 1 ); $g_failed = false; function print_test_result( $p_result ) { global $g_failed; if ( BAD == $p_result ) { $g_failed = true; echo '<td bgcolor="#ff0088">BAD</td>'; } if ( GOOD == $p_result ) { echo '<td bgcolor="#00ff88">GOOD</td>'; } } //temporary default values $t_hostname = 'localhost'; $t_db_password = ''; $t_database_name = 'bugtrack'; $t_db_username = ''; ?> <html> <head> <title> Mantis Administration - Pre-Installation Check </title> <link rel="stylesheet" type="text/css" href="admin.css" /> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#ffffff"> <tr class="top-bar"> <td class="links"> [ <a href="index.php">Back to Administration</a> ] </td> <td class="title"> Pre-Installation Check </td> </tr> </table> <br /><br /> <?php require_once( $g_core_path . 'obsolete.php' ); ?> <?php if ( ! isset( $_REQUEST['go'] ) ) { ?> <form method='POST'> <table width="100%" border="0" cellpadding="10" cellspacing="1"> <tr> <td bgcolor="#e8e8e8" colspan="2"> <span class="title">Installation Options</span> </td> </tr> <tr> <td> Type of Database </td> <td> <select name="db_type"> <option value="mysql">MySql (default)</option> <option value="odbc_mssql">Microsoft SQL Server ODBC (experimental)</option> <option value="ado_mssql">Microsoft SQL Server ADO (experimental)</option> <option value="pgsql">PGSQL (experimental)</option> </td> </tr> <tr> <td> Hostname (for Database Server) </td> <td> <input name="hostname" type="textbox" value="<?php echo $t_hostname; ?>"></input> </td> </tr> <tr> <td> Username (for Database) </td> <td> <input name="db_username" type="textbox" value="<?php echo $t_db_username; ?>"></input> </td> </tr> <tr> <td> Password (for Database) </td> <td> <input name="db_password" type="textbox" value="<?php echo $t_db_password; ?>"></input> </td> </tr> <tr> <td> Database name (for Database) </td> <td> <input name="database_name" type="textbox" value="<?php echo $t_database_name; ?>"></input> </td> </tr> <tr> <td> Attempt Installation </td> <td> <input name="go" type="submit" ></input> </td> </tr> </table> </form> <?php exit(); } ?> <table width="100%" bgcolor="#222222" border="0" cellpadding="10" cellspacing="1"> <tr> <td bgcolor="#e8e8e8" colspan="2"> <span class="title">Attempting Installation...</span> </td> </tr> <!-- Check Php Version --> <tr> <td bgcolor="#ffffff"> Checking PHP Version (Your version is <?php echo phpversion(); ?>) </td> <?php if (phpversion() == '4.0.6') { print_test_result( GOOD ); } else { if ( function_exists ( 'version_compare' ) ) { if ( version_compare ( phpversion() , '4.0.6', '>=' ) ) { print_test_result( GOOD ); } else { print_test_result( BAD ); } } else { print_test_result( BAD ); } } ?> </tr> <!-- Check Safe Mode --> <tr> <td bgcolor="#ffffff"> Checking If Safe mode is enabled for install script </td> <?php if ( ! ini_get ( 'SAFE_MODE' ) ) { print_test_result( GOOD ); } else { print_test_result( BAD ); } ?> </tr> <!-- Setting config variables --> <tr> <td bgcolor="#ffffff"> Setting Database Type </td> <?php $f_db_type = gpc_get('db_type', null); $g_config_entry['db_type'] = '\''.$f_db_type.'\''; if ( isset( $f_db_type ) ) { print_test_result( GOOD ); } else { print_test_result( BAD ); } ?> </tr> <!-- Checking DB support--> <tr> <td bgcolor="#ffffff"> Checking PHP support for database type </td> <?php $t_support = false; switch ($f_db_type) { case 'mysql': $t_support = function_exists('mysql_connect'); break; case 'pgsql': $t_support = function_exists('pg_connect'); break; case 'mssql': $t_support = function_exists('mssql_connect'); break; default: $t_support = false; } if ( $t_support ) { print_test_result( GOOD ); } else { print_test_result( BAD ); } ?> </tr> <!-- Setting config variables --> <tr> <td bgcolor="#ffffff"> Setting Database Hostname </td> <?php $f_hostname = gpc_get('hostname', null); $g_config_entry['hostname'] = '\''.$f_hostname.'\''; if ( isset( $f_hostname ) ) { print_test_result( GOOD ); } else { print_test_result( BAD ); } ?> </tr> <!-- Setting config variables --> <tr> <td bgcolor="#ffffff"> Setting Database Username </td> <?php $f_db_username = gpc_get('db_username', null); $g_config_entry['db_username'] = '\''.$f_db_username.'\''; if ( isset( $f_db_username ) ) { print_test_result( GOOD ); } else { print_test_result( BAD ); } ?> </tr> <!-- Setting config variables --> <tr> <td bgcolor="#ffffff"> Setting Database Password </td> <?php $f_db_password = gpc_get('db_password', null); $g_config_entry['db_password'] = '\''.$f_db_password.'\''; if ( isset( $f_db_password ) ) { print_test_result( GOOD ); } else { print_test_result( BAD ); } ?> </tr> <!-- Setting config variables --> <tr> <td bgcolor="#ffffff"> Setting Database Name </td> <?php $f_database_name = gpc_get('database_name', null); $g_config_entry['database_name'] = '\''.$f_database_name.'\''; if ( isset( $f_database_name ) ) { print_test_result( GOOD ); } else { print_test_result( BAD ); } ?> </tr> <!-- Setting config variables --> <tr> <td bgcolor="#ffffff"> Attempting to connect to database </td> <?php $g_db = $db = ADONewConnection($f_db_type); $t_result = @$g_db->Connect($f_hostname, $f_db_username, $f_db_password); if ( $t_result == true ) { print_test_result( GOOD ); } else { print_test_result( BAD ); } ?> </tr> <!-- Checking MD5 --> <tr> <td bgcolor="#ffffff"> Checking for MD5 Crypt() support </td> <?php if ( 1 === CRYPT_MD5 ) { print_test_result( GOOD ); } else { print_test_result( BAD ); } ?> </tr> <!-- Checking register_globals are off --> <tr> <td bgcolor="#ffffff"> Checking for register_globals are off for mantis </td> <?php if ( ! ini_get_bool( 'register_globals' ) ) { print_test_result( GOOD ); } else { print_test_result( BAD ); } ?> </tr> <tr> <td bgcolor="#ffffff"> Create database if it does not exist </td> <?php $t_result = @$g_db->Connect($f_hostname, $f_db_username, $f_db_password, $f_database_name); if ( $t_result == true ) { print_test_result( GOOD ); } else { // create db $g_db = ADONewConnection($f_db_type); $t_result = $g_db->Connect($f_hostname, $f_db_username, $f_db_password); $dict = NewDataDictionary($g_db); $sqlarray = $dict->CreateDatabase($f_database_name); $ret = $dict->ExecuteSQLArray($sqlarray); if( $ret == 2) { print_test_result( GOOD ); } else { print_test_result( BAD ); } } ?> </tr> <?php include "schema.php"; $g_db = ADONewConnection($f_db_type); $t_result = @$g_db->Connect($f_hostname, $f_db_username, $f_db_password, $f_database_name); $lastid = sizeof($upgrade); for($i = 0; $i < $lastid; $i++) { ?> <tr> <td bgcolor="#ffffff"> Create Schema ( Upgrading Schema to Version <?php echo $i?> ) </td> <?php $dict = NewDataDictionary($g_db); $sqlarray = call_user_func_array(Array($dict,$upgrade[$i][1]),$upgrade[$i][2]); $ret = $dict->ExecuteSQLArray($sqlarray); if ( $ret == 2 ) { print_test_result( GOOD ); } else { var_dump($sqlarray); print_test_result( BAD ); } echo '</tr>'; } ?> <tr> <td bgcolor="#ffffff"> Creating Default Config File </td> <?php if ( /*!$g_failed &&*/ ! file_exists ( $g_absolute_path .DIRECTORY_SEPARATOR.'config_inc.php' ) ) { $fd = fopen($g_absolute_path.DIRECTORY_SEPARATOR.'config_inc.php','x'); fwrite($fd, '<?php'."\r\n"); foreach ( $g_config_entry as $key => $value) { fwrite($fd,'$g_'.$key.'='.$value.";\r\n"); } fwrite($fd, '?>'."\r\n"); fclose($fd); if ( file_exists ( $g_absolute_path .DIRECTORY_SEPARATOR.'config_inc.php' ) ) { print_test_result( GOOD ); } else { print_test_result( BAD ); } } else { // already exists print_test_result( BAD ); } ?> </tr> </table> <?php if( $g_failed ) { ?> <p>Please correct failed checks</p> <?php } ?> </body> </html> schema.php.2 (15,255 bytes)
<? $upgrade[] = Array(1,'CreateTableSQL',Array(config_get('mantis_bug_file_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, bug_id I UNSIGNED NOTNULL DEFAULT '0', title C(250) NOTNULL DEFAULT \" '' \", description C(250) NOTNULL DEFAULT \" '' \", diskfile C(250) NOTNULL DEFAULT \" '' \", filename C(250) NOTNULL DEFAULT \" '' \", folder C(250) NOTNULL DEFAULT \" '' \", filesize I NOTNULL DEFAULT '0', file_type C(250) NOTNULL DEFAULT \" '' \", date_added T NOTNULL DEFAULT '1970-01-01 00:00:01', content B NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(2,'CreateTableSQL',Array(config_get('mantis_bug_history_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, user_id I UNSIGNED NOTNULL DEFAULT '0', bug_id I UNSIGNED NOTNULL DEFAULT '0', date_modified T NOTNULL DEFAULT '1970-01-01 00:00:01', field_name C(32) NOTNULL DEFAULT \" '' \", old_value C(128) NOTNULL DEFAULT \" '' \", new_value C(128) NOTNULL DEFAULT \" '' \", type I2 NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(3,'CreateTableSQL',Array(config_get('mantis_bug_monitor_table')," user_id I UNSIGNED NOTNULL PRIMARY DEFAULT '0', bug_id I UNSIGNED NOTNULL PRIMARY DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(4,'CreateTableSQL',Array(config_get('mantis_bug_relationship_table')," id I UNSIGNED NOTNULL AUTOINCREMENT PRIMARY, source_bug_id I UNSIGNED NOTNULL DEFAULT '0', destination_bug_id I UNSIGNED NOTNULL DEFAULT '0', relationship_type I2 NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(5,'CreateTableSQL',Array(config_get('mantis_bug_table')," id I UNSIGNED PRIMARY NOTNULL AUTOINCREMENT, project_id I UNSIGNED NOTNULL DEFAULT '0', reporter_id I UNSIGNED NOTNULL DEFAULT '0', handler_id I UNSIGNED NOTNULL DEFAULT '0', duplicate_id I UNSIGNED NOTNULL DEFAULT '0', priority I2 NOTNULL DEFAULT '30', severity I2 NOTNULL DEFAULT '50', reproducibility I2 NOTNULL DEFAULT '10', status I2 NOTNULL DEFAULT '10', resolution I2 NOTNULL DEFAULT '10', projection I2 NOTNULL DEFAULT '10', category C(64) NOTNULL DEFAULT \" '' \", date_submitted T NOTNULL DEFAULT '1970-01-01 00:00:01', last_updated T NOTNULL DEFAULT '1970-01-01 00:00:01', eta I2 NOTNULL DEFAULT '10', bug_text_id I UNSIGNED NOTNULL DEFAULT '0', os C(32) NOTNULL DEFAULT \" '' \", os_build C(32) NOTNULL DEFAULT \" '' \", platform C(32) NOTNULL DEFAULT \" '' \", version C(64) NOTNULL DEFAULT \" '' \", fixed_in_version C(64) NOTNULL DEFAULT \" '' \", build C(32) NOTNULL DEFAULT \" '' \", profile_id I UNSIGNED NOTNULL DEFAULT '0', view_state I2 NOTNULL DEFAULT '10', summary C(128) NOTNULL DEFAULT \" '' \", sponsorship_total I NOTNULL DEFAULT '0', sticky L NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(6,'CreateTableSQL',Array(config_get('mantis_bug_text_table')," id I PRIMARY UNSIGNED NOTNULL AUTOINCREMENT, description XS NOTNULL, steps_to_reproduce XS NOTNULL, additional_information XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(7,'CreateTableSQL',Array(config_get('mantis_bugnote_table')," id I UNSIGNED PRIMARY NOTNULL AUTOINCREMENT, bug_id I UNSIGNED NOTNULL DEFAULT '0', reporter_id I UNSIGNED NOTNULL DEFAULT '0', bugnote_text_id I UNSIGNED NOTNULL DEFAULT '0', view_state I2 NOTNULL DEFAULT '10', date_submitted T NOTNULL DEFAULT '1970-01-01 00:00:01', last_modified T NOTNULL DEFAULT '1970-01-01 00:00:01', note_type I DEFAULT '0', note_attr C(250) DEFAULT \" '' \" ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(8,'CreateTableSQL',Array(config_get('mantis_bugnote_text_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, note XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(9,'CreateTableSQL',Array(config_get('mantis_custom_field_project_table')," field_id I NOTNULL PRIMARY DEFAULT '0', project_id I UNSIGNED PRIMARY NOTNULL DEFAULT '0', sequence I2 NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(10,'CreateTableSQL',Array(config_get('mantis_custom_field_string_table')," field_id I NOTNULL PRIMARY DEFAULT '0', bug_id I NOTNULL PRIMARY DEFAULT '0', value C(255) NOTNULL DEFAULT \" '' \" ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(11,'CreateTableSQL',Array(config_get('mantis_custom_field_table')," id I NOTNULL PRIMARY AUTOINCREMENT, name C(64) NOTNULL DEFAULT \" '' \", type I2 NOTNULL DEFAULT '0', possible_values C(255) NOTNULL DEFAULT \" '' \", default_value C(255) NOTNULL DEFAULT \" '' \", valid_regexp C(255) NOTNULL DEFAULT \" '' \", access_level_r I2 NOTNULL DEFAULT '0', access_level_rw I2 NOTNULL DEFAULT '0', length_min I NOTNULL DEFAULT '0', length_max I NOTNULL DEFAULT '0', advanced L NOTNULL DEFAULT '0', require_report L NOTNULL DEFAULT '0', require_update L NOTNULL DEFAULT '0', display_report L NOTNULL DEFAULT '1', display_update L NOTNULL DEFAULT '1', require_resolved L NOTNULL DEFAULT '0', display_resolved L NOTNULL DEFAULT '0', display_closed L NOTNULL DEFAULT '0', require_closed L NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(12,'CreateTableSQL',Array(config_get('mantis_filters_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, user_id I NOTNULL DEFAULT '0', project_id I NOTNULL DEFAULT '0', is_public L DEFAULT NULL, name C(64) NOTNULL DEFAULT \" '' \", filter_string XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(13,'CreateTableSQL',Array(config_get('mantis_news_table')," id I UNSIGNED PRIMARY NOTNULL AUTOINCREMENT, project_id I UNSIGNED NOTNULL DEFAULT '0', poster_id I UNSIGNED NOTNULL DEFAULT '0', date_posted T NOTNULL DEFAULT '1970-01-01 00:00:01', last_modified T NOTNULL DEFAULT '1970-01-01 00:00:01', view_state I2 NOTNULL DEFAULT '10', announcement L NOTNULL DEFAULT '0', headline C(64) NOTNULL DEFAULT \" '' \", body XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(14,'CreateTableSQL',Array(config_get('mantis_project_category_table')," project_id I UNSIGNED NOTNULL PRIMARY DEFAULT '0', category C(64) NOTNULL PRIMARY DEFAULT \" '' \", user_id I UNSIGNED NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(15,'CreateTableSQL',Array(config_get('mantis_project_file_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, project_id I UNSIGNED NOTNULL DEFAULT '0', title C(250) NOTNULL DEFAULT \" '' \", description C(250) NOTNULL DEFAULT \" '' \", diskfile C(250) NOTNULL DEFAULT \" '' \", filename C(250) NOTNULL DEFAULT \" '' \", folder C(250) NOTNULL DEFAULT \" '' \", filesize I NOTNULL DEFAULT '0', file_type C(250) NOTNULL DEFAULT \" '' \", date_added T NOTNULL DEFAULT '1970-01-01 00:00:01', content B NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(16,'CreateTableSQL',Array(config_get('mantis_project_table')," id I UNSIGNED PRIMARY NOTNULL AUTOINCREMENT, name C(128) NOTNULL DEFAULT \" '' \", status I2 NOTNULL DEFAULT '10', enabled L NOTNULL DEFAULT '1', view_state I2 NOTNULL DEFAULT '10', access_min I2 NOTNULL DEFAULT '10', file_path C(250) NOTNULL DEFAULT \" '' \", description XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(17,'CreateTableSQL',Array(config_get('mantis_project_user_list_table')," project_id I UNSIGNED PRIMARY NOTNULL DEFAULT '0', user_id I UNSIGNED PRIMARY NOTNULL DEFAULT '0', access_level I2 NOTNULL DEFAULT '10' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(18,'CreateTableSQL',Array(config_get('mantis_project_version_table')," id I NOTNULL PRIMARY AUTOINCREMENT, project_id I UNSIGNED NOTNULL DEFAULT '0', version C(64) NOTNULL DEFAULT \" '' \", date_order T NOTNULL DEFAULT '1970-01-01 00:00:01', description XS NOTNULL, released L NOTNULL DEFAULT '1' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(19,'CreateTableSQL',Array(config_get('mantis_sponsorship_table')," id I NOTNULL PRIMARY AUTOINCREMENT, bug_id I NOTNULL DEFAULT '0', user_id I NOTNULL DEFAULT '0', amount I NOTNULL DEFAULT '0', logo C(128) NOTNULL DEFAULT \" '' \", url C(128) NOTNULL DEFAULT \" '' \", paid L NOTNULL DEFAULT '0', date_submitted T NOTNULL DEFAULT '1970-01-01 00:00:01', last_updated T NOTNULL DEFAULT '1970-01-01 00:00:01' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(20,'CreateTableSQL',Array(config_get('mantis_database')," schema_version int ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(21,'CreateTableSQL',Array(config_get('mantis_user_pref_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, user_id I UNSIGNED NOTNULL DEFAULT '0', project_id I UNSIGNED NOTNULL DEFAULT '0', default_profile I UNSIGNED NOTNULL DEFAULT '0', default_project I UNSIGNED NOTNULL DEFAULT '0', advanced_report L NOTNULL DEFAULT '0', advanced_view L NOTNULL DEFAULT '0', advanced_update L NOTNULL DEFAULT '0', refresh_delay I NOTNULL DEFAULT '0', redirect_delay L NOTNULL DEFAULT '0', bugnote_order C(4) NOTNULL DEFAULT 'ASC', email_on_new L NOTNULL DEFAULT '0', email_on_assigned L NOTNULL DEFAULT '0', email_on_feedback L NOTNULL DEFAULT '0', email_on_resolved L NOTNULL DEFAULT '0', email_on_closed L NOTNULL DEFAULT '0', email_on_reopened L NOTNULL DEFAULT '0', email_on_bugnote L NOTNULL DEFAULT '0', email_on_status L NOTNULL DEFAULT '0', email_on_priority L NOTNULL DEFAULT '0', email_on_priority_min_severity I2 NOTNULL DEFAULT '10', email_on_status_min_severity I2 NOTNULL DEFAULT '10', email_on_bugnote_min_severity I2 NOTNULL DEFAULT '10', email_on_reopened_min_severity I2 NOTNULL DEFAULT '10', email_on_closed_min_severity I2 NOTNULL DEFAULT '10', email_on_resolved_min_severity I2 NOTNULL DEFAULT '10', email_on_feedback_min_severity I2 NOTNULL DEFAULT '10', email_on_assigned_min_severity I2 NOTNULL DEFAULT '10', email_on_new_min_severity I2 NOTNULL DEFAULT '10', email_bugnote_limit I2 NOTNULL DEFAULT '0', language C(32) NOTNULL DEFAULT 'english' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(22,'CreateTableSQL',Array(config_get('mantis_user_print_pref_table')," user_id I UNSIGNED NOTNULL PRIMARY DEFAULT '0', print_pref C(27) NOTNULL DEFAULT \" '' \" ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(23,'CreateTableSQL',Array(config_get('mantis_user_profile_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, user_id I UNSIGNED NOTNULL DEFAULT '0', platform C(32) NOTNULL DEFAULT \" '' \", os C(32) NOTNULL DEFAULT \" '' \", os_build C(32) NOTNULL DEFAULT \" '' \", description XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(24,'CreateTableSQL',Array(config_get('mantis_user_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, username C(32) NOTNULL DEFAULT \" '' \", realname C(64) NOTNULL DEFAULT \" '' \", email C(64) NOTNULL DEFAULT \" '' \", password C(32) NOTNULL DEFAULT \" '' \", date_created T NOTNULL DEFAULT '1970-01-01 00:00:01', last_visit T NOTNULL DEFAULT '1970-01-01 00:00:01', enabled L NOTNULL DEFAULT '1', protected L NOTNULL DEFAULT '0', access_level I2 NOTNULL DEFAULT '10', login_count I NOTNULL DEFAULT '0', lost_password_request_count I2 NOTNULL DEFAULT '0', failed_login_count I2 NOTNULL DEFAULT '0', cookie_string C(64) NOTNULL DEFAULT \" '' \" ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(25, 'CreateIndexSQL',Array('idx_bug_file_bug_id',config_get('mantis_bug_file_table'),'bug_id')); $upgrade[] = Array(26, 'CreateIndexSQL',Array('idx_bug_history_bug_id',config_get('mantis_bug_history_table'),'bug_id')); $upgrade[] = Array(27, 'CreateIndexSQL',Array('idx_user_cookie_string',config_get('mantis_user_table'),'cookie_string',Array('UNIQUE'))); $upgrade[] = Array(28, 'CreateIndexSQL',Array('idx_user_username',config_get('mantis_user_table'),'username',Array('UNIQUE'))); $upgrade[] = Array(29, 'CreateIndexSQL',Array('idx_project_id',config_get('mantis_project_table'),'id')); $upgrade[] = Array(30, 'CreateIndexSQL',Array('idx_project_name',config_get('mantis_project_table'),'name',Array('UNIQUE'))); $upgrade[] = Array(31, 'CreateIndexSQL',Array('idx_project_version',config_get('mantis_project_version_table'),'project_id,version',Array('UNIQUE'))); $upgrade[] = Array(32, 'CreateIndexSQL',Array('idx_history_user_id',config_get('mantis_bug_history_table'),'user_id')); $upgrade[] = Array(33, 'CreateIndexSQL',Array('idx_relationship_source',config_get('mantis_bug_relationship_table'),'source_bug_id')); $upgrade[] = Array(34, 'CreateIndexSQL',Array('idx_relationship_destination',config_get('mantis_bug_relationship_table'),'destination_bug_id')); $upgrade[] = Array(35, 'CreateIndexSQL',Array('idx_bug_sponsorship_total',config_get('mantis_bug_table'),'sponsorship_total')); $upgrade[] = Array(36, 'CreateIndexSQL',Array('idx_bug_fixed_in_version',config_get('mantis_bug_table'),'fixed_in_version')); $upgrade[] = Array(37, 'CreateIndexSQL',Array('idx_custom_field_name',config_get('mantis_custom_field_table'),'name')); $upgrade[] = Array(38, 'CreateIndexSQL',Array('idx_news_id',config_get('mantis_news_table'),'id')); $upgrade[] = Array(39, 'CreateIndexSQL',Array('idx_sponsorship_bug_id',config_get('mantis_sponsorship_table'),'bug_id')); $upgrade[] = Array(40, 'CreateIndexSQL',Array('idx_sponsorship_user_id',config_get('mantis_sponsorship_table'),'user_id')); $upgrade[] = Array(41,'CreateTableSQL',Array(config_get('mantis_tokens_table')," id I NOTNULL PRIMARY AUTOINCREMENT, owner I NOTNULL, type I NOTNULL, timestamp T NOTNULL, expiry T, value XS NOTNULL", Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); ?> schema.php.3 (15,929 bytes)
<? $upgrade[] = Array(1,'CreateTableSQL',Array(config_get('mantis_bug_file_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, bug_id I UNSIGNED NOTNULL DEFAULT '0', title C(250) NOTNULL DEFAULT \" '' \", description C(250) NOTNULL DEFAULT \" '' \", diskfile C(250) NOTNULL DEFAULT \" '' \", filename C(250) NOTNULL DEFAULT \" '' \", folder C(250) NOTNULL DEFAULT \" '' \", filesize I NOTNULL DEFAULT '0', file_type C(250) NOTNULL DEFAULT \" '' \", date_added T NOTNULL DEFAULT '1970-01-01 00:00:01', content B NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(2,'CreateTableSQL',Array(config_get('mantis_bug_history_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, user_id I UNSIGNED NOTNULL DEFAULT '0', bug_id I UNSIGNED NOTNULL DEFAULT '0', date_modified T NOTNULL DEFAULT '1970-01-01 00:00:01', field_name C(32) NOTNULL DEFAULT \" '' \", old_value C(128) NOTNULL DEFAULT \" '' \", new_value C(128) NOTNULL DEFAULT \" '' \", type I2 NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(3,'CreateTableSQL',Array(config_get('mantis_bug_monitor_table')," user_id I UNSIGNED NOTNULL PRIMARY DEFAULT '0', bug_id I UNSIGNED NOTNULL PRIMARY DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(4,'CreateTableSQL',Array(config_get('mantis_bug_relationship_table')," id I UNSIGNED NOTNULL AUTOINCREMENT PRIMARY, source_bug_id I UNSIGNED NOTNULL DEFAULT '0', destination_bug_id I UNSIGNED NOTNULL DEFAULT '0', relationship_type I2 NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(5,'CreateTableSQL',Array(config_get('mantis_bug_table')," id I UNSIGNED PRIMARY NOTNULL AUTOINCREMENT, project_id I UNSIGNED NOTNULL DEFAULT '0', reporter_id I UNSIGNED NOTNULL DEFAULT '0', handler_id I UNSIGNED NOTNULL DEFAULT '0', duplicate_id I UNSIGNED NOTNULL DEFAULT '0', priority I2 NOTNULL DEFAULT '30', severity I2 NOTNULL DEFAULT '50', reproducibility I2 NOTNULL DEFAULT '10', status I2 NOTNULL DEFAULT '10', resolution I2 NOTNULL DEFAULT '10', projection I2 NOTNULL DEFAULT '10', category C(64) NOTNULL DEFAULT \" '' \", date_submitted T NOTNULL DEFAULT '1970-01-01 00:00:01', last_updated T NOTNULL DEFAULT '1970-01-01 00:00:01', eta I2 NOTNULL DEFAULT '10', bug_text_id I UNSIGNED NOTNULL DEFAULT '0', os C(32) NOTNULL DEFAULT \" '' \", os_build C(32) NOTNULL DEFAULT \" '' \", platform C(32) NOTNULL DEFAULT \" '' \", version C(64) NOTNULL DEFAULT \" '' \", fixed_in_version C(64) NOTNULL DEFAULT \" '' \", build C(32) NOTNULL DEFAULT \" '' \", profile_id I UNSIGNED NOTNULL DEFAULT '0', view_state I2 NOTNULL DEFAULT '10', summary C(128) NOTNULL DEFAULT \" '' \", sponsorship_total I NOTNULL DEFAULT '0', sticky L NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(6,'CreateTableSQL',Array(config_get('mantis_bug_text_table')," id I PRIMARY UNSIGNED NOTNULL AUTOINCREMENT, description XS NOTNULL, steps_to_reproduce XS NOTNULL, additional_information XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(7,'CreateTableSQL',Array(config_get('mantis_bugnote_table')," id I UNSIGNED PRIMARY NOTNULL AUTOINCREMENT, bug_id I UNSIGNED NOTNULL DEFAULT '0', reporter_id I UNSIGNED NOTNULL DEFAULT '0', bugnote_text_id I UNSIGNED NOTNULL DEFAULT '0', view_state I2 NOTNULL DEFAULT '10', date_submitted T NOTNULL DEFAULT '1970-01-01 00:00:01', last_modified T NOTNULL DEFAULT '1970-01-01 00:00:01', note_type I DEFAULT '0', note_attr C(250) DEFAULT \" '' \" ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(8,'CreateTableSQL',Array(config_get('mantis_bugnote_text_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, note XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(9,'CreateTableSQL',Array(config_get('mantis_custom_field_project_table')," field_id I NOTNULL PRIMARY DEFAULT '0', project_id I UNSIGNED PRIMARY NOTNULL DEFAULT '0', sequence I2 NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(10,'CreateTableSQL',Array(config_get('mantis_custom_field_string_table')," field_id I NOTNULL PRIMARY DEFAULT '0', bug_id I NOTNULL PRIMARY DEFAULT '0', value C(255) NOTNULL DEFAULT \" '' \" ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(11,'CreateTableSQL',Array(config_get('mantis_custom_field_table')," id I NOTNULL PRIMARY AUTOINCREMENT, name C(64) NOTNULL DEFAULT \" '' \", type I2 NOTNULL DEFAULT '0', possible_values C(255) NOTNULL DEFAULT \" '' \", default_value C(255) NOTNULL DEFAULT \" '' \", valid_regexp C(255) NOTNULL DEFAULT \" '' \", access_level_r I2 NOTNULL DEFAULT '0', access_level_rw I2 NOTNULL DEFAULT '0', length_min I NOTNULL DEFAULT '0', length_max I NOTNULL DEFAULT '0', advanced L NOTNULL DEFAULT '0', require_report L NOTNULL DEFAULT '0', require_update L NOTNULL DEFAULT '0', display_report L NOTNULL DEFAULT '1', display_update L NOTNULL DEFAULT '1', require_resolved L NOTNULL DEFAULT '0', display_resolved L NOTNULL DEFAULT '0', display_closed L NOTNULL DEFAULT '0', require_closed L NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(12,'CreateTableSQL',Array(config_get('mantis_filters_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, user_id I NOTNULL DEFAULT '0', project_id I NOTNULL DEFAULT '0', is_public L DEFAULT NULL, name C(64) NOTNULL DEFAULT \" '' \", filter_string XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(13,'CreateTableSQL',Array(config_get('mantis_news_table')," id I UNSIGNED PRIMARY NOTNULL AUTOINCREMENT, project_id I UNSIGNED NOTNULL DEFAULT '0', poster_id I UNSIGNED NOTNULL DEFAULT '0', date_posted T NOTNULL DEFAULT '1970-01-01 00:00:01', last_modified T NOTNULL DEFAULT '1970-01-01 00:00:01', view_state I2 NOTNULL DEFAULT '10', announcement L NOTNULL DEFAULT '0', headline C(64) NOTNULL DEFAULT \" '' \", body XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(14,'CreateTableSQL',Array(config_get('mantis_project_category_table')," project_id I UNSIGNED NOTNULL PRIMARY DEFAULT '0', category C(64) NOTNULL PRIMARY DEFAULT \" '' \", user_id I UNSIGNED NOTNULL DEFAULT '0' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(15,'CreateTableSQL',Array(config_get('mantis_project_file_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, project_id I UNSIGNED NOTNULL DEFAULT '0', title C(250) NOTNULL DEFAULT \" '' \", description C(250) NOTNULL DEFAULT \" '' \", diskfile C(250) NOTNULL DEFAULT \" '' \", filename C(250) NOTNULL DEFAULT \" '' \", folder C(250) NOTNULL DEFAULT \" '' \", filesize I NOTNULL DEFAULT '0', file_type C(250) NOTNULL DEFAULT \" '' \", date_added T NOTNULL DEFAULT '1970-01-01 00:00:01', content B NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(16,'CreateTableSQL',Array(config_get('mantis_project_table')," id I UNSIGNED PRIMARY NOTNULL AUTOINCREMENT, name C(128) NOTNULL DEFAULT \" '' \", status I2 NOTNULL DEFAULT '10', enabled L NOTNULL DEFAULT '1', view_state I2 NOTNULL DEFAULT '10', access_min I2 NOTNULL DEFAULT '10', file_path C(250) NOTNULL DEFAULT \" '' \", description XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(17,'CreateTableSQL',Array(config_get('mantis_project_user_list_table')," project_id I UNSIGNED PRIMARY NOTNULL DEFAULT '0', user_id I UNSIGNED PRIMARY NOTNULL DEFAULT '0', access_level I2 NOTNULL DEFAULT '10' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(18,'CreateTableSQL',Array(config_get('mantis_project_version_table')," id I NOTNULL PRIMARY AUTOINCREMENT, project_id I UNSIGNED NOTNULL DEFAULT '0', version C(64) NOTNULL DEFAULT \" '' \", date_order T NOTNULL DEFAULT '1970-01-01 00:00:01', description XS NOTNULL, released L NOTNULL DEFAULT '1' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(19,'CreateTableSQL',Array(config_get('mantis_sponsorship_table')," id I NOTNULL PRIMARY AUTOINCREMENT, bug_id I NOTNULL DEFAULT '0', user_id I NOTNULL DEFAULT '0', amount I NOTNULL DEFAULT '0', logo C(128) NOTNULL DEFAULT \" '' \", url C(128) NOTNULL DEFAULT \" '' \", paid L NOTNULL DEFAULT '0', date_submitted T NOTNULL DEFAULT '1970-01-01 00:00:01', last_updated T NOTNULL DEFAULT '1970-01-01 00:00:01' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(20,'CreateTableSQL',Array(config_get('mantis_database')," schema_version int ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(21,'CreateTableSQL',Array(config_get('mantis_user_pref_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, user_id I UNSIGNED NOTNULL DEFAULT '0', project_id I UNSIGNED NOTNULL DEFAULT '0', default_profile I UNSIGNED NOTNULL DEFAULT '0', default_project I UNSIGNED NOTNULL DEFAULT '0', advanced_report L NOTNULL DEFAULT '0', advanced_view L NOTNULL DEFAULT '0', advanced_update L NOTNULL DEFAULT '0', refresh_delay I NOTNULL DEFAULT '0', redirect_delay L NOTNULL DEFAULT '0', bugnote_order C(4) NOTNULL DEFAULT 'ASC', email_on_new L NOTNULL DEFAULT '0', email_on_assigned L NOTNULL DEFAULT '0', email_on_feedback L NOTNULL DEFAULT '0', email_on_resolved L NOTNULL DEFAULT '0', email_on_closed L NOTNULL DEFAULT '0', email_on_reopened L NOTNULL DEFAULT '0', email_on_bugnote L NOTNULL DEFAULT '0', email_on_status L NOTNULL DEFAULT '0', email_on_priority L NOTNULL DEFAULT '0', email_on_priority_min_severity I2 NOTNULL DEFAULT '10', email_on_status_min_severity I2 NOTNULL DEFAULT '10', email_on_bugnote_min_severity I2 NOTNULL DEFAULT '10', email_on_reopened_min_severity I2 NOTNULL DEFAULT '10', email_on_closed_min_severity I2 NOTNULL DEFAULT '10', email_on_resolved_min_severity I2 NOTNULL DEFAULT '10', email_on_feedback_min_severity I2 NOTNULL DEFAULT '10', email_on_assigned_min_severity I2 NOTNULL DEFAULT '10', email_on_new_min_severity I2 NOTNULL DEFAULT '10', email_bugnote_limit I2 NOTNULL DEFAULT '0', language C(32) NOTNULL DEFAULT 'english' ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(22,'CreateTableSQL',Array(config_get('mantis_user_print_pref_table')," user_id I UNSIGNED NOTNULL PRIMARY DEFAULT '0', print_pref C(27) NOTNULL DEFAULT \" '' \" ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(23,'CreateTableSQL',Array(config_get('mantis_user_profile_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, user_id I UNSIGNED NOTNULL DEFAULT '0', platform C(32) NOTNULL DEFAULT \" '' \", os C(32) NOTNULL DEFAULT \" '' \", os_build C(32) NOTNULL DEFAULT \" '' \", description XS NOTNULL ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(24,'CreateTableSQL',Array(config_get('mantis_user_table')," id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, username C(32) NOTNULL DEFAULT \" '' \", realname C(64) NOTNULL DEFAULT \" '' \", email C(64) NOTNULL DEFAULT \" '' \", password C(32) NOTNULL DEFAULT \" '' \", date_created T NOTNULL DEFAULT '1970-01-01 00:00:01', last_visit T NOTNULL DEFAULT '1970-01-01 00:00:01', enabled L NOTNULL DEFAULT '1', protected L NOTNULL DEFAULT '0', access_level I2 NOTNULL DEFAULT '10', login_count I NOTNULL DEFAULT '0', lost_password_request_count I2 NOTNULL DEFAULT '0', failed_login_count I2 NOTNULL DEFAULT '0', cookie_string C(64) NOTNULL DEFAULT \" '' \" ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(25, 'CreateIndexSQL',Array('idx_bug_file_bug_id',config_get('mantis_bug_file_table'),'bug_id')); $upgrade[] = Array(26, 'CreateIndexSQL',Array('idx_bug_history_bug_id',config_get('mantis_bug_history_table'),'bug_id')); $upgrade[] = Array(27, 'CreateIndexSQL',Array('idx_user_cookie_string',config_get('mantis_user_table'),'cookie_string',Array('UNIQUE'))); $upgrade[] = Array(28, 'CreateIndexSQL',Array('idx_user_username',config_get('mantis_user_table'),'username',Array('UNIQUE'))); $upgrade[] = Array(29, 'CreateIndexSQL',Array('idx_project_id',config_get('mantis_project_table'),'id')); $upgrade[] = Array(30, 'CreateIndexSQL',Array('idx_project_name',config_get('mantis_project_table'),'name',Array('UNIQUE'))); $upgrade[] = Array(31, 'CreateIndexSQL',Array('idx_project_version',config_get('mantis_project_version_table'),'project_id,version',Array('UNIQUE'))); $upgrade[] = Array(32, 'CreateIndexSQL',Array('idx_history_user_id',config_get('mantis_bug_history_table'),'user_id')); $upgrade[] = Array(33, 'CreateIndexSQL',Array('idx_relationship_source',config_get('mantis_bug_relationship_table'),'source_bug_id')); $upgrade[] = Array(34, 'CreateIndexSQL',Array('idx_relationship_destination',config_get('mantis_bug_relationship_table'),'destination_bug_id')); $upgrade[] = Array(35, 'CreateIndexSQL',Array('idx_bug_sponsorship_total',config_get('mantis_bug_table'),'sponsorship_total')); $upgrade[] = Array(36, 'CreateIndexSQL',Array('idx_bug_fixed_in_version',config_get('mantis_bug_table'),'fixed_in_version')); $upgrade[] = Array(37, 'CreateIndexSQL',Array('idx_custom_field_name',config_get('mantis_custom_field_table'),'name')); $upgrade[] = Array(38, 'CreateIndexSQL',Array('idx_news_id',config_get('mantis_news_table'),'id')); $upgrade[] = Array(39, 'CreateIndexSQL',Array('idx_sponsorship_bug_id',config_get('mantis_sponsorship_table'),'bug_id')); $upgrade[] = Array(40, 'CreateIndexSQL',Array('idx_sponsorship_user_id',config_get('mantis_sponsorship_table'),'user_id')); $upgrade[] = Array(41,'CreateTableSQL',Array(config_get('mantis_tokens_table')," id I NOTNULL PRIMARY AUTOINCREMENT, owner I NOTNULL, type I NOTNULL, timestamp T NOTNULL, expiry T, value XS NOTNULL", Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(42,'CreateTableSQL',Array(config_get('mantis_project_hierarchy_table')," child_id I UNSIGNED NOTNULL, parent_id I UNSIGNED NOTNULL", Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); $upgrade[] = Array(42,'CreateTableSQL',Array(config_get('mantis_config_table')," config_id C(64) NOTNULL, project_id I DEFAULT '0', user_id I DEFAULT '0', access I DEFAULT '0', type I DEFAULT '90', value XS NOTNULL", Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS'))); /* CREATE TABLE $t_config_table ( INDEX (config_id), UNIQUE config ( config_id, project_id, user_id ) ) */ ?> | ||||
parent of | 0004871 | closed | grangeway | New SQL script for PostgreSQL port |
has duplicate | 0004846 | closed | grangeway | MSSQL DB creation : mantis_user_pref_table |
has duplicate | 0004845 | closed | grangeway | MSSQL DB creation : mantis_filters_table |
has duplicate | 0004504 | closed | grangeway | Using ADODB XML Schema for DB Creation |
related to | 0005540 | closed | vboctor | PostgreSQL script does not match MySQL script |
related to | 0006853 | closed | dregad | Instalation in oracle Database ... |
related to | 0007644 | closed | dregad | Problems when creating the Mantis database schema on Oracle |
Per a forum request: http://forums.mantisbt.org/viewtopic.php?t=61 I would like to assist in testing/porting the db backend to various databases in this particular order: Oracle, SQLite, and PostgreSQL. |
|
Oracle (oci8) needs this run prior to create tables with default dates to ensure it will take the date format: ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'; |
|
heh, guess we need to add some blank upgrades before upgrade 0 to that schema then. |
|
Once per new db connection. A DBA can set up that NLS_DATE_FORMAT as a default, but we can't assume this is done. |
|
I just wanted to bring my note on 0004504 (which you can close if you like) across to here... Once this is sorted out, I think we should provide an easy way to move data from one database/server to another. I've currently got a script that works for me, but will try and do some more testing before attaching it. |
|
Oracle Specific Issues: Identifiers to long on tables:
Trigger Identifiers to long:
Index Identifiers to long:
I get an "such colum list already indexed" error for: For date fields to take: core/adodb/drivers/adodb-oci8.inc.php Line#84 |
|
In install.php: Around like #317 "Attempting to connect to database" The connect method call is missing "$f_database_name" causing a false fail on the ability to connect to database. Should be: |
|
The following change is required to config_defaults for schema to import using install.php: |
|
Invalid SQL Generated in/for install.php (col type of "xs") for OCI8: CREATE TABLE mantis_bug_text ( The problem is a missing type "XS" in core/adodb/datadict/datadict-oci8.inc.php |
|
Per thraxisp, 2005.03.17, via IIRC: schema.php should be further modified to reference the $g_mantis_TABLENAME via config_get('mantis_TABLENAME') Example: |
|
" Other than varchar(4000), what are the other data formats that could be used for XS? Paul |
|
Use CLOB (char blob) for up to 2GB of space. |
|
If there's no downsides to using 'clobs', I guess that would be more appropriate than a varchar field. |
|
I dont see any issues unless adodb can not handle the CLOB object from oracle. In a project at work for credit checking processing with Dunns & Bradstreet, I had to break the returned report into two and put it in two seperate varchar(4000) fields. |
|
From the latest provided schema.php: mantis_config table has a column "access", this is a reserved word in Oracle. |
|
schema.php.3 has fields as NOT NULL when NULL is allowed within application (CVS HEAD). Table: Table: |
|
Initial cut at installer put in CVS. admin/install.php -> 1.1 |
|
That´s funny, I accidentially clicked on "Sponsor". Didn´t really want to sponsor this issue.... Sorry for that. |
|
What's the status of getting mantis working with oracle? we'd love to help if it's stalled. |
|
The last db column naming fix (_miminum_severity -> _min_severity) is in CVS. An almost ready for prime time version of the installer is in CVS. This is tested on mysql, but not others. |
|
This effort still underway? |
|
All of this is in 1.0.0rc2. It's not been well tested on dbs other than MySQL and PostgreSQL. |
|
Hello Guys, I Think that the original bug issue has been 'resolved' at least for mysql (and alpha(beta?) : pgsql/mssql. There's obviously a few people interesting in other databases e.g. oracle. I think for the sake of sanity the best thing to do from here is: Paul |
|