From 88cf3c76e93a96662687634b30f605b8d2ac6165 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 16 Mar 2023 15:14:13 +0000 Subject: [PATCH] Bug 32437: (QA follow-up) Prevent upgrade if wrong PRIMARY KEY key present Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/atomicupdate/bug_32437.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/installer/data/mysql/atomicupdate/bug_32437.pl b/installer/data/mysql/atomicupdate/bug_32437.pl index 6ff91391b9..16343ad018 100755 --- a/installer/data/mysql/atomicupdate/bug_32437.pl +++ b/installer/data/mysql/atomicupdate/bug_32437.pl @@ -12,6 +12,9 @@ return { } elsif( !primary_key_exists('import_auths','import_record_id') ){ say $out "Found an existing PRIMARY KEY on import_auths table"; say $out "You must delete this key and replace it with a key on import_record_id"; + say $out " ALTER TABLE import_auths DROP PRIMARY KEY;"; + say $out " ALTER TABLE import_auths ADD PRIMARY KEY (import_record_id);"; + die "Interrupting installer process: database revision for bug 32437 fails!"; } else { say $out "PRIMARY KEY import_record_id on import_auths already exists"; } -- 2.39.5