]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 289453: components.initialowner is different in Bugzilla::DB::Schema than it...
authormkanat%kerio.com <>
Thu, 14 Apr 2005 13:58:24 +0000 (13:58 +0000)
committermkanat%kerio.com <>
Thu, 14 Apr 2005 13:58:24 +0000 (13:58 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=Tomas.Kopal, a=justdave

Bugzilla/DB/Schema.pm
checksetup.pl

index 3d008a09bf2ca9d0f9be98961925e3a470f605b8..9ef1f6214aaed44fa16534beb2e50e7126a4aed4 100644 (file)
@@ -832,7 +832,7 @@ use constant ABSTRACT_SCHEMA => {
                                  PRIMARYKEY => 1},
             name             => {TYPE => 'varchar(64)', NOTNULL => 1},
             product_id       => {TYPE => 'INT2', NOTNULL => 1},
-            initialowner     => {TYPE => 'INT3'},
+            initialowner     => {TYPE => 'INT3', NOTNULL => 1},
             initialqacontact => {TYPE => 'INT3'},
             description      => {TYPE => 'MEDIUMTEXT', NOTNULL => 1},
         ],
index fa8cf7354574656004cd2cb4275ca3de98c0c310..f64bd350a338b40774de61638c4fd7c6c4548a93 100755 (executable)
@@ -3944,6 +3944,17 @@ add_setting ("comment_sort_order", {"oldest_to_newest" => 1,
 $dbh->bz_change_field_type('products', 'classification_id',
                            'smallint NOT NULL DEFAULT 1');
 
+# initialowner was accidentally NULL when we checked-in Schema,
+# when it really should be NOT NULL.
+if ($dbh->bz_get_field_def('components', 'initialowner')->[2]) { # if NULL
+    # There's technically no way a real NULL could have gotten into
+    # initialowner, but better safe than sorry.
+    $dbh->do('UPDATE components SET initialowner = 0 
+               WHERE initialowner IS NULL');
+    $dbh->bz_change_field_type('components', 'initialowner', 
+                               'mediumint NOT NULL');
+}
+
 } # END LEGACY CHECKS
 
 # If you had to change the --TABLE-- definition in any way, then add your