Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@188 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed Feb 11, 2001
1 parent ee075a3 commit fd70666
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 65 deletions.
139 changes: 83 additions & 56 deletions UPGRADING
@@ -1,56 +1,83 @@
# -------------------------------------------------------------------------------
# Upgrading
# -------------------------------------------------------------------------------

# Here are the basic steps to upgrade the database tables
# Take a look in db_upgrade.sql as well.

# =================
# 0.11.x to 0.12.0
# =================

# Add a new field to store profile descriptions

ALTER TABLE mantis_bug_table ADD profile_id INT UNSIGNED ZEROFILL not null AFTER votes

# =================
# 0.10.2 to 0.11.0
# =================

# I've added a profile table and inserted feedback into the main bug table.
# Also modified version to be an enum (edit using the manage section)
# Run these queries:

ALTER TABLE mantis_bug_table CHANGE status status ENUM ('new','fdeedback',
'acknowledged','confirmed','assigned','resolved') DEFAULT 'new' not null;

CREATE TABLE mantis_user_profile_table (
id int(10) unsigned zerofill DEFAULT '0000000000' NOT NULL auto_increment,
user_id int(10) unsigned zerofill DEFAULT '0000000000' NOT NULL,
platform varchar(32) NOT NULL,
os varchar(32) NOT NULL,
os_build varchar(16) NOT NULL,
description text NOT NULL,
default_profile char(3) NOT NULL,
PRIMARY KEY (id)
);

ALTER TABLE mantis_bug_table CHANGE version version ENUM ('none') not null;

CREATE TABLE mantis_user_pref_table (
id int(10) unsigned zerofill DEFAULT '0000000000' NOT NULL auto_increment,
user_id int(10) unsigned zerofill DEFAULT '0000000000' NOT NULL,
advanced_report char(3) NOT NULL,
advanced_view char(3) NOT NULL,
PRIMARY KEY (id)
);

# =================
# 0.9.x to 0.10.x
# =================

# You will need to add a 'protected' field in the mantis_user_table.
# This command will do the trick:

ALTER TABLE mantis_user_table ADD protected VARCHAR (3) not null

# -------------------------------------------------------------------------------
# Upgrading
# -------------------------------------------------------------------------------

# Here are the basic steps to upgrade the database tables
# Take a look in db_upgrade.sql as well.

# =================
# 0.12.0 to 0.14.0
# =================

Due to many changes the upgrade procedure is more complicated than before. I
will try my best to clearly illustrate the needed steps below.

The primary issue is that you may lose your date stamps for user logins and,
more importanly, all bug data. This is due to the time being stored in a
TIMESTAMP field (which is a design error on my part). Secondarily, all news
and bugs are associated with the first project_id (0000001). The first project
defaults to mantis but feel free to rename it. DO NOT DELETE IT. If you have
no projects in your database you will not be able to login.

You will want to run the upgrade.php3 file. Just type it into the url field.
Hopefully everything goes well with no errors. If you don't worry about the
date then you can just run the queries in db_upgrade.sql

If you have existing categories they will be converted to varchar(32) in each
bug report. To make sure that you can index these correctly you will need to
create categories reflecting this. So if your original bug table had
('bugtracker','security','other') then you would need to add these three
categories to your project. You can access this from via
Manage->Projects->Edit. Same thing goes for versions.

News posts with a project_id=0000000 are sitewide posts (and vice versa)

# =================
# 0.11.x to 0.12.0
# =================

# Add a new field to store profile descriptions

ALTER TABLE mantis_bug_table ADD profile_id INT UNSIGNED ZEROFILL not null AFTER votes

# =================
# 0.10.2 to 0.11.0
# =================

# I've added a profile table and inserted feedback into the main bug table.
# Also modified version to be an enum (edit using the manage section)
# Run these queries:

ALTER TABLE mantis_bug_table CHANGE status status ENUM ('new','fdeedback',
'acknowledged','confirmed','assigned','resolved') DEFAULT 'new' not null;

CREATE TABLE mantis_user_profile_table (
id int(10) unsigned zerofill DEFAULT '0000000000' NOT NULL auto_increment,
user_id int(10) unsigned zerofill DEFAULT '0000000000' NOT NULL,
platform varchar(32) NOT NULL,
os varchar(32) NOT NULL,
os_build varchar(16) NOT NULL,
description text NOT NULL,
default_profile char(3) NOT NULL,
PRIMARY KEY (id)
);

ALTER TABLE mantis_bug_table CHANGE version version ENUM ('none') not null;

CREATE TABLE mantis_user_pref_table (
id int(10) unsigned zerofill DEFAULT '0000000000' NOT NULL auto_increment,
user_id int(10) unsigned zerofill DEFAULT '0000000000' NOT NULL,
advanced_report char(3) NOT NULL,
advanced_view char(3) NOT NULL,
PRIMARY KEY (id)
);

# =================
# 0.9.x to 0.10.x
# =================

# You will need to add a 'protected' field in the mantis_user_table.
# This command will do the trick:

ALTER TABLE mantis_user_table ADD protected VARCHAR (3) not null

11 changes: 2 additions & 9 deletions upgrade.php3
@@ -1,13 +1,6 @@
<? include( "core_API.php" ) ?>
<? #login_cookie_check() ?>
<?
db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );
/*
if ( !access_level_check_greater_or_equal( "administrator" ) ) {
### need to replace with access error page
header( "Location: $g_logout_page" );
exit;
}*/
?>
<?
if ( $f_action=="upgrade" ) {
Expand Down Expand Up @@ -106,7 +99,7 @@ if ( $result3 ) {
extract( $row, EXTR_PREFIX_ALL, "v" );

$query2 = "UPDATE $g_mantis_bug_table
SET date_submitted='$v_date_submitted', last_updated='$v_last_updated'
SET date_submitted='$v_date_submitted', last_updated='$v_last_updated', project_id='0000001'
WHERE id='$v_id'";
$result2 = db_query( $query2 );
}
Expand Down Expand Up @@ -134,7 +127,7 @@ if ( $result3 ) {
extract( $row, EXTR_PREFIX_ALL, "v" );

$query2 = "UPDATE $g_mantis_news_table
SET date_posted='$v_date_posted', last_modified='$v_last_modified'
SET date_posted='$v_date_posted', last_modified='$v_last_modified', project_id='0000001'
WHERE id='$v_id'";
$result2 = db_query( $query2 );
}
Expand Down

0 comments on commit fd70666

Please sign in to comment.