Bugzilla – Attachment 97322 Details for
Bug 21520
More complex OAI sets mappings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21520: (QA follow-up): Updatedatabase
Bug-21520-QA-follow-up-Updatedatabase.patch (text/plain), 1.70 KB, created by
Jonathan Druart
on 2020-01-13 15:46:17 UTC
(
hide
)
Description:
Bug 21520: (QA follow-up): Updatedatabase
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-01-13 15:46:17 UTC
Size:
1.70 KB
patch
obsolete
>From f71f6a77a2df8e7d9db765b8a4991459b2224434 Mon Sep 17 00:00:00 2001 >From: Matthias Meusburger <matthias.meusburger@biblibre.com> >Date: Mon, 13 Jan 2020 16:26:30 +0100 >Subject: [PATCH] Bug 21520: (QA follow-up): Updatedatabase > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > installer/data/mysql/atomicupdate/bug_21520.perl | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > >diff --git a/installer/data/mysql/atomicupdate/bug_21520.perl b/installer/data/mysql/atomicupdate/bug_21520.perl >index 6b5a56e797..ccf3178164 100644 >--- a/installer/data/mysql/atomicupdate/bug_21520.perl >+++ b/installer/data/mysql/atomicupdate/bug_21520.perl >@@ -2,6 +2,25 @@ $DBversion = 'XXX'; # will be replaced by the RM > if( CheckVersion( $DBversion ) ) { > $dbh->do( "ALTER TABLE oai_sets_mappings ADD COLUMN rule_order INT AFTER set_id, ADD COLUMN rule_operator VARCHAR(3) AFTER rule_order" ); > $dbh->do( "UPDATE oai_sets_mappings SET rule_operator='or'" ); >+ my $sets = $dbh->selectall_arrayref("SELECT * from oai_sets_mappings ORDER BY set_id", { Slice => {} }); >+ my $i = 0; >+ my $previous_set_id; >+ for my $set ( @{$sets}) { >+ my $set_id = $set->{set_id}; >+ >+ if ($previous_set_id && $previous_set_id != $set_id) { >+ $i = 0; >+ } >+ >+ if ($i == 0) { >+ $dbh->do("UPDATE oai_sets_mappings SET rule_operator=NULL WHERE set_id=? LIMIT 1", {}, $set_id); >+ } >+ >+ $dbh->do("UPDATE oai_sets_mappings SET rule_order=? WHERE set_id=? AND rule_order IS NULL LIMIT 1", {}, $i, $set_id); >+ >+ $i++; >+ $previous_set_id = $set_id; >+ } > > # Always end with this (adjust the bug info) > SetVersion( $DBversion ); >-- >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 21520
:
96041
|
96052
|
96790
|
97319
|
97320
|
97321
| 97322