diff options
author | dave%intrec.com <> | 2001-03-07 12:09:29 +0100 |
---|---|---|
committer | dave%intrec.com <> | 2001-03-07 12:09:29 +0100 |
commit | 1b45faadd1f3a4e080a53dafd3edee4dc753833d (patch) | |
tree | b0e3ab5952e3959f9b5f566fb3de9fa6662a14eb | |
parent | 3cdefc4150ec4404da02e19d24b9314ab399af09 (diff) | |
download | bugzilla-1b45faadd1f3a4e080a53dafd3edee4dc753833d.tar.gz bugzilla-1b45faadd1f3a4e080a53dafd3edee4dc753833d.tar.xz |
Fix for bug 62949: Initial Test Component on new install did not have initialOwner, which made sanitycheck complain.
-rwxr-xr-x | checksetup.pl | 61 |
1 files changed, 34 insertions, 27 deletions
diff --git a/checksetup.pl b/checksetup.pl index a23ba6a50..abc3fea44 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -1038,32 +1038,6 @@ if (!GroupExists("canconfirm")) { ########################################################################### -# Create initial test product if there are no products present. -########################################################################### - -my $sth = $dbh->prepare("SELECT product FROM products"); -$sth->execute; -unless ($sth->rows) { - print "Creating initial dummy product 'TestProduct' ...\n"; - $dbh->do('INSERT INTO products(product, description, milestoneurl, disallownew, votesperuser, votestoconfirm) VALUES ("TestProduct", - "This is a test product. This ought to be blown away and ' . - 'replaced with real stuff in a finished installation of ' . - 'bugzilla.", "", 0, 0, 0)'); - $dbh->do('INSERT INTO versions (value, program) VALUES ("other", "TestProduct")'); - $dbh->do('INSERT INTO components (value, program, description, initialowner, initialqacontact) - 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.", "", "")'); - $dbh->do('INSERT INTO milestones (product, value) VALUES ("TestProduct","---")'); -} - - - - - -########################################################################### # Populate the list of fields. ########################################################################### @@ -1249,7 +1223,7 @@ sub bailout { # this is just in case we get interrupted while getting passwd exit 1; } -$sth = $dbh->prepare(<<_End_Of_SQL_); +my $sth = $dbh->prepare(<<_End_Of_SQL_); SELECT login_name FROM profiles WHERE groupset=9223372036854775807 @@ -1371,6 +1345,39 @@ _End_Of_SQL_ } +########################################################################### +# Create initial test product if there are no products present. +########################################################################### + +$sth = $dbh->prepare(<<_End_Of_SQL_); + SELECT userid + FROM profiles + WHERE groupset=9223372036854775807 +_End_Of_SQL_ +$sth->execute; +my ($adminuid) = $sth->fetchrow_array; +if (!$adminuid) { die "No administator!" } # should never get here +$sth = $dbh->prepare("SELECT product FROM products"); +$sth->execute; +unless ($sth->rows) { + print "Creating initial dummy product 'TestProduct' ...\n"; + $dbh->do('INSERT INTO products(product, description, milestoneurl, disallownew, votesperuser, votestoconfirm) VALUES ("TestProduct", + "This is a test product. This ought to be blown away and ' . + 'replaced with real stuff in a finished installation of ' . + 'bugzilla.", "", 0, 0, 0)'); + $dbh->do('INSERT INTO versions (value, program) VALUES ("other", "TestProduct")'); + $dbh->do("INSERT INTO components (value, program, description, initialowner, initialqacontact) + 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.', $adminuid, 0)"); + $dbh->do('INSERT INTO milestones (product, value) VALUES ("TestProduct","---")'); +} + + + + ########################################################################### # Update the tables to the current definition |