Bugzilla – Attachment 86953 Details for
Bug 18235
Elastic search - Configurable facets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18235: (QA follow-up) Make db update idempotent
Bug-18235-QA-follow-up-Make-db-update-idempotent.patch (text/plain), 3.07 KB, created by
Josef Moravec
on 2019-03-23 09:44:47 UTC
(
hide
)
Description:
Bug 18235: (QA follow-up) Make db update idempotent
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2019-03-23 09:44:47 UTC
Size:
3.07 KB
patch
obsolete
>From 5516ba4e2d4ad70cf36b4eaa86a56e416d07a418 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Mon, 4 Mar 2019 13:52:19 +0000 >Subject: [PATCH] Bug 18235: (QA follow-up) Make db update idempotent > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > .../bug_18235-add-search_field-facet_order.perl | 20 ++++++++++++++++++++ > .../bug_18235-add-search_field-facet_order.sql | 10 ---------- > 2 files changed, 20 insertions(+), 10 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.perl > delete mode 100644 installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.sql > >diff --git a/installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.perl b/installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.perl >new file mode 100644 >index 0000000000..fd5ee93ff2 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.perl >@@ -0,0 +1,20 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ if( !column_exists( 'search_field', 'facet_order' ) ) { >+ $dbh->do("ALTER TABLE search_field ADD COLUMN facet_order TINYINT(4) DEFAULT NULL AFTER weight"); >+ } >+ >+ $dbh->do("UPDATE search_field SET facet_order=1 WHERE name='author'"); >+ $dbh->do("UPDATE search_field SET facet_order=2 WHERE name='itype'"); >+ $dbh->do("UPDATE search_field SET facet_order=3 WHERE name='location'"); >+ $dbh->do("UPDATE search_field SET facet_order=4 WHERE name='su-geo'"); >+ $dbh->do("UPDATE search_field SET facet_order=5 WHERE name='se'"); >+ $dbh->do("UPDATE search_field SET facet_order=6 WHERE name='subject'"); >+ $dbh->do("UPDATE search_field SET facet_order=7 WHERE name='ccode'"); >+ $dbh->do("UPDATE search_field SET facet_order=8 WHERE name='holdingbranch'"); >+ $dbh->do("UPDATE search_field SET facet_order=9 WHERE name='homebranch'"); >+ >+ # Always end with this (adjust the bug info) >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 18235 - Elastic search - make facets configurable)\n"; >+} >diff --git a/installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.sql b/installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.sql >deleted file mode 100644 >index 6cf83ab947..0000000000 >--- a/installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.sql >+++ /dev/null >@@ -1,10 +0,0 @@ >-ALTER TABLE search_field ADD COLUMN facet_order TINYINT(4) DEFAULT NULL AFTER weight; >-UPDATE search_field SET facet_order=1 WHERE name='author'; >-UPDATE search_field SET facet_order=2 WHERE name='itype'; >-UPDATE search_field SET facet_order=3 WHERE name='location'; >-UPDATE search_field SET facet_order=4 WHERE name='su-geo'; >-UPDATE search_field SET facet_order=5 WHERE name='se'; >-UPDATE search_field SET facet_order=6 WHERE name='subject'; >-UPDATE search_field SET facet_order=7 WHERE name='ccode'; >-UPDATE search_field SET facet_order=8 WHERE name='holdingbranch'; >-UPDATE search_field SET facet_order=9 WHERE name='homebranch'; >-- >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 18235
:
60931
|
60932
|
60933
|
61528
|
61529
|
61530
|
64747
|
69485
|
69486
|
69487
|
72936
|
72937
|
72938
|
72999
|
73000
|
73001
|
73193
|
74642
|
74643
|
75995
|
75996
|
85212
|
85213
|
85214
|
85215
|
85216
|
85885
|
85886
|
85969
|
85970
|
85983
|
85984
|
85985
|
85986
|
85987
|
85988
|
85989
|
85990
|
85991
|
85992
|
86340
|
86341
|
86342
|
86343
|
86344
|
86345
|
86346
|
86347
|
86348
|
86349
|
86350
|
86944
|
86945
|
86946
|
86947
|
86948
|
86949
|
86950
|
86951
|
86952
| 86953 |
86954
|
86955
|
86956
|
87141