Bugzilla – Attachment 97319 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.62 KB, created by
Matthias Meusburger
on 2020-01-13 15:29:00 UTC
(
hide
)
Description:
Bug 21520: (QA follow-up): Updatedatabase
Filename:
MIME Type:
Creator:
Matthias Meusburger
Created:
2020-01-13 15:29:00 UTC
Size:
1.62 KB
patch
obsolete
>From 0a70aef2a3df68d457be0911246eb09e17139521 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 > >--- > 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 6b5a56e..ccf3178 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.7.4
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