Code bit for upgrading from 2.5

RESOLVED FIXED in Bugzilla 2.12

Status

()

Bugzilla
Bugzilla-General
P3
major
RESOLVED FIXED
18 years ago
6 years ago

People

(Reporter: Eric Hanson, Assigned: Chris Yeh)

Tracking

unspecified
Bugzilla 2.12
x86
Linux

Details

Attachments

(2 attachments)

(Reporter)

Description

18 years ago
Hi,
  I recently upgraded from bugzilla 2.5 and found that the setup.pl script
missed a few things.  The descriptions are stored in a table called comments,
that uses a "when" field and other minor things.  I found that the below lines
of code altered the comments table and changed it to longdesc and worked fine. 
I think it should be enclosed in a if statment (checking that the table
"comments" exists), but I am not familiar enough with MySql to check if a table
exists.
Heres the code:

# 2000-11-27  For bugzilla 2.5 and later, 
#  had to restructure comments to longdescs the new
#  name of the comments table
RenameField ('comments', 'when', 'bug_when');
ChangeFieldType('comments', 'bug_id', 'mediumint not null');
ChangeFieldType('comments', 'who', 'mediumint not null');
ChangeFieldType('comments', 'bug_when', 'datetime not null');
RenameField('comments','comment','thetext');
# Here we rename comments to longdescs
$dbh->do("DROP TABLE longdescs");
$dbh->do("ALTER TABLE comments RENAME longdescs");

Just wanted to say that bugzilla is the most edit-customize friendly code I have
ever worked on, without souding like a kiss up.
P.S.  I checked the severity definitions and since there is loss of data I
figured Major severity was approp.  Sorry in advance if it isn't.
(Reporter)

Updated

18 years ago
Whiteboard: Bugzilla 2.12 ?
(Reporter)

Comment 1

18 years ago
Created attachment 23297 [details] [diff] [review]
This patch is a diff -u for checksetup.pl from bz 2.10, sorry I renamed the checksetup.pl to mychecksetup.pl.

Updated

18 years ago
Keywords: patch, review
This patch _definitely_ needs to be changed so the code is inside some sort of 
check to make sure it's not executed on any other versions. Otherwise Very Nasty 
Things will happen to a lot of Bugzilla installations.

ehanson@talkware.net - any chance of working out a suitable guard, and updating 
the patch?

Gerv
moving to real milestones...
Whiteboard: Bugzilla 2.12 ?
Target Milestone: --- → Bugzilla 2.12

Comment 4

18 years ago
reassigning...
Assignee: tara → cyeh
(Assignee)

Comment 5

18 years ago
Created attachment 26451 [details] [diff] [review]
wrap code around new TableExists() call
(Assignee)

Comment 6

18 years ago
add dave
Status: NEW → ASSIGNED
(Assignee)

Comment 7

18 years ago
fix checked into trunk
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
Moving closed bugs to Bugzilla product
Component: Bugzilla → Bugzilla-General
Product: Webtools → Bugzilla
Version: other → unspecified
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.