Bugzilla – Attachment 58880 Details for
Bug 14187
branchtransfer needs a primary key (id) for DBIx and common sense.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14187: (QA followup) Properly check DB structure before altering it
Bug-14187-QA-followup-Properly-check-DB-structure-.patch (text/plain), 1.68 KB, created by
Tomás Cohen Arazi (tcohen)
on 2017-01-12 15:43:28 UTC
(
hide
)
Description:
Bug 14187: (QA followup) Properly check DB structure before altering it
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2017-01-12 15:43:28 UTC
Size:
1.68 KB
patch
obsolete
>From 90f0c803bd5647f95c0d8becd4d70f309ff36ec7 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 12 Jan 2017 12:42:05 -0300 >Subject: [PATCH] Bug 14187: (QA followup) Properly check DB structure before > altering it > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > installer/data/mysql/atomicupdate/14187.perl | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/14187.perl b/installer/data/mysql/atomicupdate/14187.perl >index 02022b4c37..5a7fa67f40 100644 >--- a/installer/data/mysql/atomicupdate/14187.perl >+++ b/installer/data/mysql/atomicupdate/14187.perl >@@ -1,8 +1,15 @@ >-$DBversion = 'XXX'; # will be replaced by the RM >-if( CheckVersion( $DBversion ) ) { >- $dbh->do("ALTER TABLE branchtransfers ADD COLUMN branchtransfer_id int(12) NOT NULL auto_increment FIRST, ADD CONSTRAINT PRIMARY KEY (branchtransfer_id);"); >+$DBversion = '16.12.00.XXX'; >+if ( CheckVersion($DBversion) ) { >+ unless (column_exists( 'branchtransfers', 'branchtransfer_id' ) >+ and index_exists( 'branchtransfers', 'PRIMARY' ) ) >+ { >+ $dbh->do( >+ "ALTER TABLE branchtransfers >+ ADD COLUMN branchtransfer_id int(12) NOT NULL auto_increment FIRST, ADD CONSTRAINT PRIMARY KEY (branchtransfer_id);" >+ ); >+ } > > # Always end with this (adjust the bug info) >- SetVersion( $DBversion ); >- print "Upgrade to $DBversion done (Bug 14187 - branchtransfer needs a primary key (id) for DBIx and common sense.)\n"; >+ SetVersion($DBversion); >+ print "Upgrade to $DBversion done (Bug 14187: branchtransfer needs a primary key (id) for DBIx and common sense.)\n"; > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14187
:
39058
|
39059
|
39060
|
40075
|
58121
|
58123
|
58124
|
58646
|
58730
|
58880
|
58881
|
58882