]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 7233: Editversions.cgi has a potential race resulting in duplicate versions ...
authorlpsolit%gmail.com <>
Wed, 4 May 2005 01:23:37 +0000 (01:23 +0000)
committerlpsolit%gmail.com <>
Wed, 4 May 2005 01:23:37 +0000 (01:23 +0000)
Bugzilla/DB/Schema.pm
checksetup.pl

index 1b905ac01a98646721ff6d081144edd202349395..8682f1721a4d9e159e982ad61b7cba7c89b76bf9 100644 (file)
@@ -455,9 +455,13 @@ use constant ABSTRACT_SCHEMA => {
 
     versions => {
         FIELDS => [
-            value      =>  {TYPE => 'TINYTEXT'},
+            value      =>  {TYPE => 'varchar(64)', NOTNULL => 1},
             product_id =>  {TYPE => 'INT2', NOTNULL => 1},
         ],
+        INDEXES => [
+            versions_product_id_idx => {FIELDS => [qw(product_id value)],
+                                        TYPE => 'UNIQUE'},
+        ],
     },
 
     milestones => {
index 565fa1e70226fb3a0b070ef250b15f3e34d97fcc..ef3d80735c9a7840c417f9c83a10d1c0c2b9bb9d 100755 (executable)
@@ -3937,6 +3937,13 @@ $dbh->bz_add_index('flags', 'flags_type_id_idx', [qw(type_id)]);
 # For a short time, the flags_type_id_idx was misnamed in upgraded installs.
 $dbh->bz_drop_index('flags', 'type_id');
 
+# 2005-04-28 - LpSolit@gmail.com - Bug 7233: add an index to versions
+$dbh->bz_alter_column('versions', 'value',
+                      {TYPE => 'varchar(64)', NOTNULL => 1});
+$dbh->bz_add_index('versions', 'versions_product_id_idx',
+                   {TYPE => 'UNIQUE', FIELDS => [qw(product_id value)]});
+
+
 
 # If you had to change the --TABLE-- definition in any way, then add your
 # differential change code *** A B O V E *** this comment.