From 1da5153872ffbe188daa476791f1a18384167b34 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 4 May 2005 01:23:37 +0000 Subject: [PATCH] =?utf8?q?Bug=207233:=20Editversions.cgi=20has=20a=20poten?= =?utf8?q?tial=20race=20resulting=20in=20duplicate=20versions=20-=20Patch?= =?utf8?q?=20by=20Fr=C3=A9d=C3=A9ric=20Buclin=20=20r=3D?= =?utf8?q?mkanat=20a=3Djustdave?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Bugzilla/DB/Schema.pm | 6 +++++- checksetup.pl | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index 1b905ac01a..8682f1721a 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -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 => { diff --git a/checksetup.pl b/checksetup.pl index 565fa1e702..ef3d80735c 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -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. -- 2.47.2