📄 0_17_inc.php
字号:
<?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 # Changes applied to 0.17 database to give us ____ # -------------------------------------------------------- # $Id: 0_17_inc.php,v 1.14 2005/07/14 21:38:01 thraxisp Exp $ # --------------------------------------------------------?><?php require( dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'db_table_names_inc.php' ); $upgrades = array(); $upgrades[] = new SQLUpgrade( '0.17-jf-1', 'Printing Preference Table', "CREATE TABLE IF NOT EXISTS $t_user_print_pref_table (user_id int(7) unsigned zerofill NOT ". "NULL default '0000000', print_pref varchar(27) NOT NULL default '', PRIMARY KEY ". "(user_id))" ); $upgrades[] = new FunctionUpgrade( '0.17-jf-2', 'Bug history', 'upgrade_0_17_jf_2' ); function upgrade_0_17_jf_2() { global $t_bug_history_table; if ( !db_field_exists( 'type', $t_bug_history_table ) ) { $query = "ALTER TABLE $t_bug_history_table ADD type INT(2) NOT NULL"; $result = @db_query( $query ); if ( false == $result ) { return false; } } return true; } $upgrades[] = new FunctionUpgrade( '0.17-jf-3', 'Auto-assigning of bugs for a default user per category', 'upgrade_0_17_jf_3' ); function upgrade_0_17_jf_3() { global $t_project_category_table; if ( !db_field_exists( 'user_id', $t_project_category_table ) ) { $query = "ALTER TABLE $t_project_category_table ADD user_id INT(7) NOT NULL"; $result = @db_query( $query ); if ( false == $result ) { return false; } } return true; } $upgrades[] = new FunctionUpgrade( '0.17-jf-4', 'Private news support', 'upgrade_0_17_jf_4' ); function upgrade_0_17_jf_4() { global $t_news_table; if ( !db_field_exists( 'view_state', $t_news_table ) ) { $query = "ALTER TABLE $t_news_table ADD view_state INT(2) DEFAULT '10' NOT NULL AFTER last_modified"; $result = @db_query( $query ); if ( false == $result ) { return false; } } return true; } $upgrades[] = new FunctionUpgrade( '0.17-jf-5', 'Allow news items to stay at the top', 'upgrade_0_17_jf_5' ); function upgrade_0_17_jf_5() { global $t_news_table; if ( !db_field_exists( 'announcement', $t_news_table ) ) { $query = "ALTER TABLE $t_news_table ADD announcement INT(1) NOT NULL AFTER view_state"; $result = @db_query( $query ); if ( false == $result ) { return false; } } return true; } $upgrades[] = new FunctionUpgrade( '0.17-jf-6', 'relationship support', 'upgrade_0_17_jf_6' ); function upgrade_0_17_jf_6() { global $t_bug_relationship_table; if ( !db_field_exists( 'id', $t_bug_relationship_table ) ) { $query = "ALTER TABLE $t_bug_relationship_table ADD id INT(7) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST"; $result = @db_query( $query ); if ( false == $result ) { return false; } } return true; } $upgrades[] = new SQLUpgrade( '0.17-custom-field-1', 'Add mantis_custom_field_table', "CREATE TABLE IF NOT EXISTS $t_custom_field_table ( id int(3) NOT NULL auto_increment, name varchar(64) NOT NULL default '', type int(2) NOT NULL default '0', possible_values varchar(255) NOT NULL default '', default_value varchar(255) NOT NULL default '', valid_regexp varchar(255) NOT NULL default '', access_level_r int(2) NOT NULL default '0', access_level_rw int(2) NOT NULL default '0', length_min int(3) NOT NULL default '0', length_max int(3) NOT NULL default '0', advanced int(1) NOT NULL default '0', PRIMARY KEY (id), KEY name (name))" ); $upgrades[] = new SQLUpgrade( '0.17-custom-field-2', 'Add mantis_custom_field_string_table', "CREATE TABLE IF NOT EXISTS $t_custom_field_string_table ( field_id int(3) NOT NULL, bug_id int(7) NOT NULL, value varchar(255) NOT NULL default '', PRIMARY KEY (field_id,bug_id))" ); $upgrades[] = new SQLUpgrade( '0.17-custom-field-3', 'Add mantis_custom_field_project_table', "CREATE TABLE IF NOT EXISTS $t_custom_field_project_table ( field_id int(3) NOT NULL, project_id int(7) unsigned NOT NULL, sequence int(2) NOT NULL default '0', PRIMARY KEY (field_id,project_id))" ); $upgrades[] = new SQLUpgrade( '0.17-jf-7', 'Drop mantis_project_customization_table', "DROP TABLE IF EXISTS mantis_project_customization_table" ); $upgrades[] = new SQLUpgrade( '0.17-jf-8', 'Drop votes column of mantis_bug_table', "ALTER TABLE $t_bug_table DROP COLUMN votes" ); $upgrades[] = new SQLUpgrade( '0.17-jf-9', 'Add primary key on mantis_project_version_table', "ALTER IGNORE TABLE $t_project_version_table ADD PRIMARY KEY (project_id,version)" ); $upgrades[] = new SQLUpgrade( '0.17-jf-10', 'Add primary key on mantis_project_user_list_table', "ALTER IGNORE TABLE $t_project_user_list_table ADD PRIMARY KEY (project_id,user_id)" ); $upgrades[] = new SQLUpgrade( '0.17-jf-11', 'Add primary key on mantis_project_category_table', "ALTER IGNORE TABLE $t_project_category_table ADD PRIMARY KEY (project_id,category)" ); $upgrades[] = new SQLUpgrade( '0.17-jf-12', 'Add primary key on mantis_bug_monitor_table', "ALTER IGNORE TABLE $t_bug_monitor_table ADD PRIMARY KEY (user_id,bug_id)" ); $upgrades[] = new SQLUpgrade( '0.17-jf-13', 'Remove zerofill on mantis_bug_file_table.id', "ALTER TABLE $t_bug_file_table MODIFY id int(7) unsigned NOT NULL auto_increment" ); $upgrades[] = new SQLUpgrade( '0.17-jf-14', 'Remove zerofill on mantis_bug_file_table.bug_id', "ALTER TABLE $t_bug_file_table MODIFY bug_id int(7) unsigned NOT NULL" ); $upgrades[] = new SQLUpgrade( '0.17-jf-15', 'Remove zerofill on mantis_bug_history_table.user_id', "ALTER TABLE $t_bug_history_table MODIFY user_id int(7) unsigned NOT NULL" ); $upgrades[] = new SQLUpgrade( '0.17-jf-16', 'Remove zerofill on mantis_bug_history_table.bug_id', "ALTER TABLE $t_bug_history_table MODIFY bug_id int(7) unsigned NOT NULL" ); $upgrades[] = new SQLUpgrade( '0.17-jf-17', 'Remove zerofill on mantis_bug_monitor_table.user_id', "ALTER TABLE $t_bug_monitor_table MODIFY user_id int(7) unsigned NOT NULL" ); $upgrades[] = new SQLUpgrade( '0.17-jf-18', 'Remove zerofill on mantis_bug_relationship_table.id', "ALTER TABLE $t_bug_relationship_table MODIFY id int(7) unsigned NOT NULL auto_increment" ); $upgrades[] = new SQLUpgrade( '0.17-jf-19', 'Remove zerofill on mantis_bug_relationship_table.source_bug_id', "ALTER TABLE $t_bug_relationship_table MODIFY source_bug_id int(7) unsigned NOT NULL default 0" ); $upgrades[] = new SQLUpgrade( '0.17-jf-20', 'Remove zerofill on mantis_bug_relationship_table.destination_bug_id', "ALTER TABLE $t_bug_relationship_table MODIFY destination_bug_id int(7) unsigned NOT NULL default 0" ); $upgrades[] = new SQLUpgrade( '0.17-jf-21', 'Remove zerofill on mantis_bug_table.id', "ALTER TABLE $t_bug_table MODIFY id int(7) unsigned NOT NULL auto_increment" ); $upgrades[] = new SQLUpgrade( '0.17-jf-22', 'Remove zerofill on mantis_bug_table.project_id', "ALTER TABLE $t_bug_table MODIFY project_id int(7) unsigned NOT NULL" ); $upgrades[] = new SQLUpgrade( '0.17-jf-23', 'Remove zerofill on mantis_bug_table.reporter_id', "ALTER TABLE $t_bug_table MODIFY reporter_id int(7) unsigned NOT NULL default 0" ); $upgrades[] = new SQLUpgrade( '0.17-jf-24', 'Remove zerofill on mantis_bug_table.handler_id', "ALTER TABLE $t_bug_table MODIFY handler_id int(7) unsigned NOT NULL default 0" ); $upgrades[] = new SQLUpgrade( '0.17-jf-25', 'Remove zerofill on mantis_bug_table.duplicate_id', "ALTER TABLE $t_bug_table MODIFY duplicate_id int(7) unsigned NOT NULL default 0" ); $upgrades[] = new SQLUpgrade( '0.17-jf-26', 'Remove zerofill on mantis_bug_table.bug_text_id', "ALTER TABLE $t_bug_table MODIFY bug_text_id int(7) unsigned NOT NULL" ); $upgrades[] = new SQLUpgrade( '0.17-jf-27', 'Remove zerofill on mantis_bug_table.profile_id', "ALTER TABLE $t_bug_table MODIFY profile_id int(7) unsigned NOT NULL default 0" ); $upgrades[] = new SQLUpgrade( '0.17-jf-28', 'Remove zerofill on mantis_bug_text_table.id', "ALTER TABLE $t_bug_text_table MODIFY id int(7) unsigned NOT NULL auto_increment" ); $upgrades[] = new SQLUpgrade( '0.17-jf-29', 'Remove zerofill on mantis_bugnote_table.id', "ALTER TABLE $t_bugnote_table MODIFY id int(7) unsigned NOT NULL auto_increment" ); $upgrades[] = new SQLUpgrade( '0.17-jf-30', 'Remove zerofill on mantis_bugnote_table.bug_id', "ALTER TABLE $t_bugnote_table MODIFY bug_id int(7) unsigned NOT NULL" ); $upgrades[] = new SQLUpgrade( '0.17-jf-31', 'Remove zerofill on mantis_bugnote_table.reporter_id', "ALTER TABLE $t_bugnote_table MODIFY reporter_id int(7) unsigned NOT NULL" ); $upgrades[] = new SQLUpgrade( '0.17-jf-32', 'Remove zerofill on mantis_bugnote_table.bugnote_text_id', "ALTER TABLE $t_bugnote_table MODIFY bugnote_text_id int(7) unsigned NOT NULL" ); $upgrades[] = new SQLUpgrade( '0.17-jf-33', 'Remove zerofill on mantis_bugnote_text_table.id', "ALTER TABLE $t_bugnote_text_table MODIFY id int(7) unsigned NOT NULL auto_increment" ); $upgrades[] = new SQLUpgrade( '0.17-jf-34', 'Remove zerofill on mantis_news_table.id', "ALTER TABLE $t_news_table
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -