]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 296039: [PostgreSQL] Cannot create a new product
authormkanat%kerio.com <>
Tue, 21 Jun 2005 08:38:57 +0000 (08:38 +0000)
committermkanat%kerio.com <>
Tue, 21 Jun 2005 08:38:57 +0000 (08:38 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=wurblzap, a=myk

Bugzilla/DB/Schema.pm
checksetup.pl

index 2ca0abc1a096e4fedda6bb4e6635859c1b69eaab..c7d4a5583be3f36313c36ef11d46c59af1c2cc6e 100644 (file)
@@ -469,7 +469,8 @@ use constant ABSTRACT_SCHEMA => {
         FIELDS => [
             product_id => {TYPE => 'INT2', NOTNULL => 1},
             value      => {TYPE => 'varchar(20)', NOTNULL => 1},
-            sortkey    => {TYPE => 'INT2', NOTNULL => 1},
+            sortkey    => {TYPE => 'INT2', NOTNULL => 1,
+                           DEFAULT => 0},
         ],
         INDEXES => [
             milestones_product_id_idx => {FIELDS => [qw(product_id value)],
index 57981a63943f18dc7120b23f02dbb63b46ab86df..4cfc096e186606cf3c251e84c105278377f73ec6 100755 (executable)
@@ -3960,6 +3960,11 @@ $dbh->bz_alter_column('versions', 'value',
 $dbh->bz_add_index('versions', 'versions_product_id_idx',
                    {TYPE => 'UNIQUE', FIELDS => [qw(product_id value)]});
 
+# Milestone sortkeys get a default just like all other sortkeys.
+if (!exists $dbh->bz_column_info('milestones', 'sortkey')->{DEFAULT}) {
+    $dbh->bz_alter_column('milestones', 'sortkey', 
+                          {TYPE => 'INT2', NOTNULL => 1, DEFAULT => 0});
+}
 
 
 # If you had to change the --TABLE-- definition in any way, then add your