Commit 7404b977 authored by terry%mozilla.org's avatar terry%mozilla.org

Patch by Holger Schurig <holgerschurig@nikocity.de> -- replace all the

yicky old make*.sh files and the CHANGES file with a new, nifty checksetup.pl file that knows how to create a setup from scratch as well as upgrade an older setup to a new one. Very cool stuff!
parent a8c1b9f5
localconfig
...@@ -10,6 +10,18 @@ query the CVS tree. For example, ...@@ -10,6 +10,18 @@ query the CVS tree. For example,
will tell you what has been changed in the last week. will tell you what has been changed in the last week.
10/12/99 The CHANGES file is now obsolete! There is a new file called
checksetup.pl. You should get in the habit of running that file every time
you update your installation of Bugzilla. That file will be constantly
updated to automatically update your installation to match any code changes.
If you're curious as to what is going on, changes are commented in that file,
at the end.
Many thanks to Holger Schurig <holgerschurig@nikocity.de> for writing this
script!
10/11/99 Restructured voting database to add a cached value in each 10/11/99 Restructured voting database to add a cached value in each
bug recording how many total votes that bug has. While I'm at it, I bug recording how many total votes that bug has. While I'm at it, I
removed the unused "area" field from the bugs database. It is removed the unused "area" field from the bugs database. It is
......
...@@ -201,17 +201,8 @@ you can get at the files in that directory through your web server. ...@@ -201,17 +201,8 @@ you can get at the files in that directory through your web server.
Once all the files are in a web accessible directory, make that Once all the files are in a web accessible directory, make that
directory writable by your webserver's user (which may require just directory writable by your webserver's user (which may require just
making it world writable). Inside this main bugzilla directory issue the making it world writable).
following commands:
mkdir data
cd data
touch comments
touch nomail
touch mail
Make sure the data directory and files are writable by the webserver.
Lastly, you'll need to set up a symbolic link from /usr/bonsaitools/bin Lastly, you'll need to set up a symbolic link from /usr/bonsaitools/bin
to the correct location of your perl executable (probably /usr/bin/perl). Or, to the correct location of your perl executable (probably /usr/bin/perl). Or,
you'll have to hack all the .cgi files to change where they look for perl. you'll have to hack all the .cgi files to change where they look for perl.
...@@ -249,54 +240,19 @@ For much more information about MySQL permissions, see the MySQL documentation. ...@@ -249,54 +240,19 @@ For much more information about MySQL permissions, see the MySQL documentation.
After you've tweaked the permissions, run "mysqladmin reload" to make sure that After you've tweaked the permissions, run "mysqladmin reload" to make sure that
the database server knows to look at your new permission list. the database server knows to look at your new permission list.
Next we'll create the bugs database in MySQL. This is done using the Next, you can just run the magic checksetup.pl script. (Many thanks to Holger
'mysql' command line client. This client allows one to funnel SQL Schurig <holgerschurig@nikocity.de> for writing this script!) It will make
statements into the MySQL server directly. It's usage summary is sure things have reasonable permissions, set up the "data" directory, and
available by running: create all the MySQL tables. Just run:
mysql --help ./checksetup.pl
from the command line. The first time you run it, it will create a file called "localconfig" which you
should examine and perhaps tweak a bit. Then re-run checksetup.pl and it will
Once you've begun mysql you'll see a 'mysql>' prompt. At the prompt you do the real work.
should enter:
create database bugs; At ths point, you should have a nearly empty copy of the bug tracking setup.
quit
To create the tables necessary for bug tracking and to minimally
populate the bug tracking system you'll need to run the eight shell
scripts found in your bugzilla directory that begin with 'make'. These
scripts load data into the database by piping input into the mysql
command. Order does not matter, but this one is fine:
./makeactivitytable.sh
./makeattachmenttable.sh
./makebugtable.sh
./makecctable.sh
./makecomponenttable.sh
./makedependenciestable.sh
./makegroupstable.sh
./makelogincookiestable.sh
./makeproducttable.sh
./makeprofilestable.sh
./makeversiontable.sh
./makevotestable.sh
You may want to edit the scripts; once bugs are entered it gets very hard to
make changes. Think carefully about how you want database users to describe bugs. Here's one
suggested alternative:
priority enum("P1", "P2", "P3", "P4", "defer") not null,
bug_severity enum("critical", "normal", "low", "---",
"enhancement", "requirement", "polish") not null,
op_sys enum("Unspecified", "Windows 3.1", "Windows 95", "Windows 98",
"Windows NT", "Mac System 7", "Mac System 8", "Linux",
"Solaris", "FreeBSD", "Other Unix", "other") not null,
rep_platform enum("Unspecified", "Apple", "PC Clone", "Sun", "other"),
After running the scripts you've got a nearly empty copy of the bug tracking setup.
4. Tweaking the Bugzilla->MySQL Connection Data 4. Tweaking the Bugzilla->MySQL Connection Data
...@@ -336,7 +292,7 @@ effectively make you 'superuser'. The SQL to type is: ...@@ -336,7 +292,7 @@ effectively make you 'superuser'. The SQL to type is:
update profiles set groupset=0x7fffffffffffffff where login_name = 'XXX'; update profiles set groupset=0x7fffffffffffffff where login_name = 'XXX';
replacing XXX with your BugZilla email address. replacing XXX with your Bugzilla email address.
Now, if you go to the query page (off of the bugzilla main menu) where you'll Now, if you go to the query page (off of the bugzilla main menu) where you'll
now find a 'edit parameters' option which is filled with editable treats. now find a 'edit parameters' option which is filled with editable treats.
...@@ -468,19 +424,13 @@ hour old, so Bugzilla will eventually notice your changes by itself, but ...@@ -468,19 +424,13 @@ hour old, so Bugzilla will eventually notice your changes by itself, but
generally you want it to notice right away, so that you can test things. generally you want it to notice right away, so that you can test things.
Appendix C. Upgrading from previous versions of BugZilla Appendix C. Upgrading from previous versions of Bugzilla
The developers of BugZilla are constantly adding new tables, columns and fields.
You'll get SQL errors if you just update the code. The strategy to update is
to read the CHANGES file backwards, and apply all of the instructions given,
typically things like:
./makeattachmenttable.sh
./makegroupstable.sh
alter table products add column disallownew tinyint not null;
Someday someone should write a script that queries the existing database The developers of Bugzilla are constantly adding new tables, columns and
for all the required columns, and if any are missing, adds them. fields. You'll get SQL errors if you just update the code. The strategy to
update is to simply always run the checksetup.pl script whenever you upgrade
your installation of Bugzilla. If you want to see what has changed, you can
read the comments in that file, starting from the end.
Appendix D. History Appendix D. History
......
This diff is collapsed. Click to expand it.
#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table bugs_activity
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table bugs_activity (
bug_id mediumint not null,
who mediumint not null,
bug_when datetime not null,
field varchar(64) not null,
oldvalue tinytext,
newvalue tinytext,
index (bug_id),
index (bug_when),
index (field)
);
show columns from bugs_activity;
show index from bugs_activity;
OK_ALL_DONE
#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table attachments;
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table attachments (
attach_id mediumint not null auto_increment primary key,
bug_id mediumint not null,
creation_ts timestamp,
description mediumtext not null,
mimetype mediumtext not null,
ispatch tinyint,
filename mediumtext not null,
thedata longblob not null,
submitter_id mediumint not null,
index(bug_id),
index(creation_ts)
);
OK_ALL_DONE
#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table bugs;
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table bugs (
bug_id mediumint not null auto_increment primary key,
groupset bigint not null,
assigned_to mediumint not null, # This is a comment.
bug_file_loc text,
bug_severity enum("blocker", "critical", "major", "normal", "minor", "trivial", "enhancement") not null,
bug_status enum("NEW", "ASSIGNED", "REOPENED", "RESOLVED", "VERIFIED", "CLOSED") not null,
creation_ts datetime not null,
delta_ts timestamp,
short_desc mediumtext,
long_desc mediumtext,
op_sys enum("All", "Windows 3.1", "Windows 95", "Windows 98", "Windows NT", "Mac System 7", "Mac System 7.5", "Mac System 7.6.1", "Mac System 8.0", "Mac System 8.5", "Mac System 8.6", "AIX", "BSDI", "HP-UX", "IRIX", "Linux", "FreeBSD", "OSF/1", "Solaris", "SunOS", "Neutrino", "OS/2", "BeOS", "OpenVMS", "other") not null,
priority enum("P1", "P2", "P3", "P4", "P5") not null,
product varchar(16) not null,
rep_platform enum("All", "DEC", "HP", "Macintosh", "PC", "SGI", "Sun", "Other"),
reporter mediumint not null,
version varchar(16) not null,
area enum("BUILD", "CODE", "CONTENT", "DOC", "PERFORMANCE", "TEST", "UI", "i18n", "l10n") not null,
component varchar(50) not null,
resolution enum("", "FIXED", "INVALID", "WONTFIX", "LATER", "REMIND", "DUPLICATE", "WORKSFORME") not null,
target_milestone varchar(20) not null,
qa_contact mediumint not null,
status_whiteboard mediumtext not null,
index (assigned_to),
index (creation_ts),
index (delta_ts),
index (bug_severity),
index (bug_status),
index (op_sys),
index (priority),
index (product),
index (reporter),
index (version),
index (area),
index (component),
index (resolution),
index (target_milestone),
index (qa_contact)
);
show columns from bugs;
show index from bugs;
OK_ALL_DONE
#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table cc
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table cc (
bug_id mediumint not null,
who mediumint not null,
index(bug_id),
index(who)
);
show columns from cc;
show index from cc;
OK_ALL_DONE
#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table components
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table components (
value tinytext,
program tinytext,
initialowner tinytext not null, # Should arguably be a mediumint!
initialqacontact tinytext not null, # Should arguably be a mediumint!
description mediumtext not null
);
insert into components (value, program, description) values ("TestComponent", "TestProduct", "This is a test component in the test product database. This ought to be blown away and replaced with real stuff in a finished installation of bugzilla.");
show columns from components;
show index from components;
OK_ALL_DONE
#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table dependencies
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table dependencies (
blocked mediumint not null,
dependson mediumint not null,
index(blocked),
index(dependson)
);
show columns from dependencies;
show index from dependencies;
OK_ALL_DONE
#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table groups
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table groups (
# This must be a power of two. Groups are identified by a bit; sets of
# groups are indicated by or-ing these values together.
bit bigint not null,
name varchar(255) not null,
description text not null,
# isbuggroup is nonzero if this is a group that controls access to a set
# of bugs. In otherword, the groupset field in the bugs table should only
# have this group's bit set if isbuggroup is nonzero.
isbuggroup tinyint not null,
# User regexp is which email addresses are initially put into this group.
# This is only used when an email account is created; otherwise, profiles
# may be individually tweaked to add them in and out of groups.
userregexp tinytext not null,
unique(bit),
unique(name)
);
insert into groups (bit, name, description, userregexp) values (pow(2,0), "tweakparams", "Can tweak operating parameters", "");
insert into groups (bit, name, description, userregexp) values (pow(2,1), "editgroupmembers", "Can put people in and out of groups that they are members of.", "");
insert into groups (bit, name, description, userregexp) values (pow(2,2), "creategroups", "Can create and destroy groups.", "");
insert into groups (bit, name, description, userregexp) values (pow(2,3), "editcomponents", "Can create, destroy, and edit components.", "");
show columns from groups;
show index from groups;
# Check for bad bit values.
select "*** Bad bit value", bit from groups where bit != pow(2, round(log(bit) / log(2)));
OK_ALL_DONE
#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql bugs > /dev/null 2>/dev/null << OK_ALL_DONE
drop table logincookies;
OK_ALL_DONE
mysql bugs << OK_ALL_DONE
create table logincookies (
cookie mediumint not null auto_increment primary key,
userid mediumint not null,
cryptpassword varchar(64),
hostname varchar(128),
lastused timestamp,
index(lastused)
);
show columns from logincookies;
show index from logincookies;
OK_ALL_DONE
#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table products;
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table products (
product tinytext,
description mediumtext,
milestoneurl tinytext not null,
disallownew tinyint not null,
votesperuser smallint not null
);
insert into products(product, description) values ("TestProduct", "This is a test product. This ought to be blown away and replaced with real stuff in a finished installation of bugzilla.");
OK_ALL_DONE
#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table profiles
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table profiles (
userid mediumint not null auto_increment primary key,
login_name varchar(255) not null,
password varchar(16),
cryptpassword varchar(64),
realname varchar(255),
groupset bigint not null,
emailnotification enum("ExcludeSelfChanges", "CConly", "All") not null default "ExcludeSelfChanges",
index(login_name)
);
show columns from profiles;
show index from profiles;
OK_ALL_DONE
#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table versions
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table versions (
value tinytext,
program tinytext
);
insert into versions (value, program) values ("other", "TestProduct");
select * from versions;
show columns from versions;
show index from versions;
OK_ALL_DONE
#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table votes;
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table votes (
who mediumint not null,
bug_id mediumint not null,
count smallint not null,
index(who),
index(bug_id)
);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment