summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-06-02 02:10:04 +0200
committermkanat%bugzilla.org <>2009-06-02 02:10:04 +0200
commit34e54028237fed966388a7d3b4f7e7321a92a2e4 (patch)
treea87b4034b3c16074908c008d4a3abe6402f79631 /Bugzilla/Install.pm
parent1a9927c0c012c6c2dcc82552d0e397c992599754 (diff)
downloadbugzilla-34e54028237fed966388a7d3b4f7e7321a92a2e4.tar.gz
bugzilla-34e54028237fed966388a7d3b4f7e7321a92a2e4.tar.xz
Bug 495783: Create the default Classification before setting up foreign keys, so that the products.classification_id -> classifications.id FK doesn't fail during upgrades that add the classification_id column.
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat
Diffstat (limited to 'Bugzilla/Install.pm')
-rw-r--r--Bugzilla/Install.pm18
1 files changed, 14 insertions, 4 deletions
diff --git a/Bugzilla/Install.pm b/Bugzilla/Install.pm
index 65e19412c..c469aa857 100644
--- a/Bugzilla/Install.pm
+++ b/Bugzilla/Install.pm
@@ -217,15 +217,20 @@ sub update_system_groups {
}
-# This function should be called only after creating the admin user.
-sub create_default_product {
+sub create_default_classification {
my $dbh = Bugzilla->dbh;
+
# Make the default Classification if it doesn't already exist.
if (!$dbh->selectrow_array('SELECT 1 FROM classifications')) {
- print get_text('install_default_classification',
+ print get_text('install_default_classification',
{ name => DEFAULT_CLASSIFICATION->{name} }) . "\n";
Bugzilla::Classification->create(DEFAULT_CLASSIFICATION);
}
+}
+
+# This function should be called only after creating the admin user.
+sub create_default_product {
+ my $dbh = Bugzilla->dbh;
# And same for the default product/component.
if (!$dbh->selectrow_array('SELECT 1 FROM products')) {
@@ -426,9 +431,14 @@ Params: none
Returns: nothing.
+=item C<create_default_classification>
+
+Creates the default "Unclassified" L<Classification|Bugzilla::Classification>
+if it doesn't already exist
+
=item C<create_default_product()>
-Description: Creates the default product and classification if
+Description: Creates the default product and component if
they don't exist.
Params: none