Bugzilla – Attachment 152251 Details for
Bug 33970
We need a "backend" column in "illrequestattributes" table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33970: atomicupdate file
Bug-33970-atomicupdate-file.patch (text/plain), 2.69 KB, created by
Pedro Amorim
on 2023-06-09 14:16:07 UTC
(
hide
)
Description:
Bug 33970: atomicupdate file
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-06-09 14:16:07 UTC
Size:
2.69 KB
patch
obsolete
>From cc39d7304e1f7e990f3dabef2aa3cf40c9bebc32 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 9 Jun 2023 14:14:57 +0000 >Subject: [PATCH] Bug 33970: atomicupdate file > >--- > .../data/mysql/atomicupdate/bug_33970.pl | 55 +++++++++++++++++++ > 1 file changed, 55 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_33970.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_33970.pl b/installer/data/mysql/atomicupdate/bug_33970.pl >new file mode 100644 >index 0000000000..bd3fbd70d8 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_33970.pl >@@ -0,0 +1,55 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "33970", >+ description => "Add 'backend' column and to composite primary key in illrequestattributes", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ >+ if( !column_exists('illrequestattributes', 'backend') ) { >+ >+ say $out "Adding 'backend' column to 'illrequestattributes' table"; >+ $dbh->do( >+ q{ ALTER TABLE illrequestattributes ADD COLUMN backend varchar(80) NOT NULL COMMENT 'API ILL backend name' AFTER illrequest_id } >+ ); >+ >+ say $out "Dropping illrequestattributes_ifk foreign key in 'illrequestattributes' table "; >+ $dbh->do( >+ q{ ALTER TABLE illrequestattributes DROP FOREIGN KEY illrequestattributes_ifk } >+ ); >+ >+ say $out "Dropping primary key in 'illrequestattributes' table "; >+ $dbh->do( >+ q{ ALTER TABLE illrequestattributes DROP PRIMARY KEY } >+ ); >+ >+ say $out "Creating new primary key in 'illrequestattributes' table "; >+ $dbh->do( >+ q{ ALTER TABLE illrequestattributes ADD PRIMARY KEY( illrequest_id, backend, type (191)) } >+ ); >+ >+ say $out "Creating new foreign key constraint in 'illrequestattributes' table "; >+ $dbh->do( >+ q{ >+ ALTER TABLE illrequestattributes ADD CONSTRAINT illrequestattributes_ifk >+ FOREIGN KEY(illrequest_id) >+ REFERENCES illrequests(illrequest_id) >+ ON DELETE CASCADE ON UPDATE CASCADE; >+ } >+ ); >+ >+ say $out "Updating backend value for all pre-existing illrequestattributes"; >+ $dbh->do( >+ q{ >+ UPDATE >+ illrequestattributes ira, >+ illrequests ir >+ SET ira.backend = ir.backend >+ WHERE ira . illrequest_id = ir.illrequest_id; >+ } >+ ); >+ } >+ }, >+}; >-- >2.30.2
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 33970
:
152250
|
152251
|
152252
|
153263
|
153264
|
153265
|
154903
|
157433
|
157434
|
157435
|
157436
|
157437