Bugzilla – Attachment 38644 Details for
Bug 14069
Follow-up 13790: Fix database update to drop PK on issues/old_issues first
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14069: Drop existing primary key on items if exists
Bug-14069-Drop-existing-primary-key-on-items-if-ex.patch (text/plain), 1.41 KB, created by
Jonathan Druart
on 2015-04-29 08:20:08 UTC
(
hide
)
Description:
Bug 14069: Drop existing primary key on items if exists
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-04-29 08:20:08 UTC
Size:
1.41 KB
patch
obsolete
>From f53710493fdb50f5c8b725bdb50a0d027e2c4c5c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 29 Apr 2015 10:15:50 +0200 >Subject: [PATCH] Bug 14069: Drop existing primary key on items if exists > >On old databases, the issues table has a primary key on itemnumber. >The DBrev 3.19.00.028 (Bug 13790 - Add unique id issue_id to issues and >oldissues tables) has to remove it before adding the new primary key > >Test plan: >1/ Make sure you have an old DB, or add primary key (issues.itemnumber)manually >on a DB created before 3.19.00.028. >2/ Execute the updatedatabase.pl script >3/ You should not get any error and the primary key on itemnumber should >have been removed and the new one created as expected. >--- > installer/data/mysql/updatedatabase.pl | 7 +++++++ > 1 file changed, 7 insertions(+) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 5d1b778..1f77ff1 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -10155,6 +10155,13 @@ if ( CheckVersion($DBversion) ) { > > $DBversion = "3.19.00.028"; > if( CheckVersion($DBversion) ) { >+ eval { >+ local $dbh->{PrintError} = 0; >+ $dbh->do(q{ >+ ALTER TABLE issues DROP PRIMARY KEY >+ }); >+ }; >+ > $dbh->do(q{ > ALTER TABLE old_issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST > }); >-- >2.1.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 14069
:
38644
|
38720
|
38736