Bugzilla – Attachment 133075 Details for
Bug 30481
Drop unique constraint deleteditemsstocknumberidx for deleteditems
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30481: Drop unique constraint deleteditemsstocknumberidx
Bug-30481-Drop-unique-constraint-deleteditemsstock.patch (text/plain), 1.79 KB, created by
Marcel de Rooy
on 2022-04-07 12:02:53 UTC
(
hide
)
Description:
Bug 30481: Drop unique constraint deleteditemsstocknumberidx
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-04-07 12:02:53 UTC
Size:
1.79 KB
patch
obsolete
>From 6cf320d30468782a28ac54f36e5b57d6332f5f51 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 7 Apr 2022 11:59:53 +0000 >Subject: [PATCH] Bug 30481: Drop unique constraint deleteditemsstocknumberidx >Content-Type: text/plain; charset=utf-8 > >Resolves a sync issue between database and schema caused by >differences between structure and upgrades. Note: newer >databases do not contain this index any longer. > >Test plan: >Run dbrev. >Check SHOW CREATE TABLE deleteditems. >Verify that unique index has been dropped, regular index added. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../data/mysql/atomicupdate/bug_30481.pl | 21 +++++++++++++++++++ > 1 file changed, 21 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_30481.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_30481.pl b/installer/data/mysql/atomicupdate/bug_30481.pl >new file mode 100755 >index 0000000000..2196c63ee6 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_30481.pl >@@ -0,0 +1,21 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => 30481, >+ description => "DB schema sync for deleteditems", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ my $sql = "ALTER TABLE deleteditems MODIFY COLUMN `stocknumber` varchar(32) default NULL"; # removes comment in db >+ $dbh->do($sql); >+ if( unique_key_exists('deleteditems', 'deleteditemsstocknumberidx') ) { >+ $sql = "ALTER TABLE deleteditems DROP KEY deleteditemsstocknumberidx"; >+ $dbh->do($sql); >+ } >+ if( !index_exists('deleteditems', 'delitemstocknumberidx') ) { >+ $sql = "ALTER TABLE deleteditems ADD INDEX `delitemstocknumberidx` (`stocknumber`)"; >+ $dbh->do($sql); >+ } >+ }, >+}; >-- >2.20.1
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 30481
:
133075
|
133135
|
133136