From d4def1e24aa0e9329df1e39de161830b4884e565 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Fri, 4 Aug 2006 11:04:25 +0000 Subject: Bug 347290: Move default product and classification creation into Bugzilla::Install Patch By Max Kanat-Alexander (module owner) a=justdave --- Bugzilla/Install/DB.pm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Install') diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index 46e9b5c5a..9b29bbc76 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -449,6 +449,16 @@ sub update_table_definitions { _add_classifications_sortkey(); _move_data_nomail_into_db(); + + # The products table lacked sensible defaults. + $dbh->bz_alter_column('products', 'milestoneurl', + {TYPE => 'TINYTEXT', NOTNULL => 1, DEFAULT => "''"}); + $dbh->bz_alter_column('products', 'disallownew', + {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 0}); + $dbh->bz_alter_column('products', 'votesperuser', + {TYPE => 'INT2', NOTNULL => 1, DEFAULT => 0}); + $dbh->bz_alter_column('products', 'votestoconfirm', + {TYPE => 'INT2', NOTNULL => 1, DEFAULT => 0}); ################################################################ # New --TABLE-- changes should go *** A B O V E *** this point # @@ -1194,9 +1204,10 @@ sub _use_ids_for_products_and_components { $dbh->do("UPDATE attachstatusdefs SET product_id = $product_id " . "WHERE product = " . $dbh->quote($product)) if $dbh->bz_table_info("attachstatusdefs"); - } + } + + print "Updating the database to use component IDs.\n"; - print "Updating the database to use component IDs.\n"; $dbh->bz_add_column("components", "id", {TYPE => 'SMALLSERIAL', NOTNULL => 1, PRIMARYKEY => 1}); $dbh->bz_add_column("bugs", "component_id", -- cgit v1.2.3-24-g4f1b