diff options
author | mkanat%bugzilla.org <> | 2009-06-02 00:10:04 +0000 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-06-02 00:10:04 +0000 |
commit | 34e54028237fed966388a7d3b4f7e7321a92a2e4 (patch) | |
tree | a87b4034b3c16074908c008d4a3abe6402f79631 /Bugzilla/Install/DB.pm | |
parent | 1a9927c0c012c6c2dcc82552d0e397c992599754 (diff) | |
download | bugs-34e54028237fed966388a7d3b4f7e7321a92a2e4.tar bugs-34e54028237fed966388a7d3b4f7e7321a92a2e4.tar.gz bugs-34e54028237fed966388a7d3b4f7e7321a92a2e4.tar.bz2 bugs-34e54028237fed966388a7d3b4f7e7321a92a2e4.tar.xz bugs-34e54028237fed966388a7d3b4f7e7321a92a2e4.zip |
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/DB.pm')
-rw-r--r-- | Bugzilla/Install/DB.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index 0c9181655..53f800b82 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -24,6 +24,7 @@ use strict; use Bugzilla::Constants; use Bugzilla::Hook; +use Bugzilla::Install (); use Bugzilla::Install::Util qw(indicate_progress install_string); use Bugzilla::Util; use Bugzilla::Series; @@ -578,6 +579,13 @@ sub update_table_definitions { Bugzilla::Hook::process('install-update_db'); + # We do this here because otherwise the foreign key from + # products.classification_id to classifications.id will fail + # (because products.classification_id defaults to "1", so on upgraded + # installations it's already been set before the first Classification + # exists). + Bugzilla::Install::create_default_classification(); + $dbh->bz_setup_foreign_keys(); } |