Bugzilla – Attachment 157434 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.71 KB, created by
Martin Renvoize (ashimema)
on 2023-10-19 13:40:19 UTC
(
hide
)
Description:
Bug 33970: Atomicupdate file
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-10-19 13:40:19 UTC
Size:
2.71 KB
patch
obsolete
>From 7fdb0a45a32b8b80e2a4bb2a8510297348664b95 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 > >Signed-off-by: Chris Walton <C.J.Walton@lboro.ac.uk> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../data/mysql/atomicupdate/bug_33970.pl | 48 +++++++++++++++++++ > 1 file changed, 48 insertions(+) > create mode 100755 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 100755 >index 00000000000..b6b8d93d4b3 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_33970.pl >@@ -0,0 +1,48 @@ >+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.41.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 33970
:
152250
|
152251
|
152252
|
153263
|
153264
|
153265
|
154903
|
157433
| 157434 |
157435
|
157436
|
157437