Bugzilla – Attachment 60595 Details for
Bug 9988
Leave larger authority merges to merge_authorities cronjob (pref AuthorityMergeLimit)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9988: Table revision for need_merge_authorities
Bug-9988-Table-revision-for-needmergeauthorities.patch (text/plain), 3.12 KB, created by
Marcel de Rooy
on 2017-02-23 12:15:35 UTC
(
hide
)
Description:
Bug 9988: Table revision for need_merge_authorities
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-02-23 12:15:35 UTC
Size:
3.12 KB
patch
obsolete
>From dfc32b4e268987d91bf40705387128cad5277dec Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 14 Feb 2017 08:42:04 +0100 >Subject: [PATCH] Bug 9988: Table revision for need_merge_authorities >Content-Type: text/plain; charset=utf-8 > >In order to let merge do exactly the same when called from the merge >cron job, we need three additional fields in the table. The use of these >fields will be explained in a follow-up. > >Test plan: >Run the dbrev (updatestructure step in webinstaller). > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Also tested running kohastructure.sql for this table. >--- > installer/data/mysql/atomicupdate/bug_9988b_table.perl | 14 ++++++++++++++ > installer/data/mysql/kohastructure.sql | 11 ++++++++--- > 2 files changed, 22 insertions(+), 3 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_9988b_table.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_9988b_table.perl b/installer/data/mysql/atomicupdate/bug_9988b_table.perl >new file mode 100644 >index 0000000..d3de620 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_9988b_table.perl >@@ -0,0 +1,14 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do( >+q|ALTER TABLE need_merge_authorities >+ADD COLUMN authid_new BIGINT AFTER authid, >+ADD COLUMN reportxml text AFTER authid_new, >+ADD COLUMN timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;| >+ ); >+ >+ $dbh->do( q|UPDATE need_merge_authorities SET authid_new=authid WHERE done<>1| ); >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 9988 - Alter table need_merge_authorities)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 117c14f..7fe429b 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1252,10 +1252,15 @@ CREATE TABLE `matchchecks` ( > -- > > DROP TABLE IF EXISTS `need_merge_authorities`; >-CREATE TABLE `need_merge_authorities` ( -- keeping track of authority records still to be merged by merge_authority cron job (used only if pref dontmerge is ON) >+CREATE TABLE `need_merge_authorities` ( -- keeping track of authority records still to be merged by merge_authority cron job > `id` int NOT NULL auto_increment PRIMARY KEY, -- unique id >- `authid` bigint NOT NULL, -- reference to authority record >- `done` tinyint DEFAULT 0 -- indication whether merge has been executed (0=not done, 1= done, 2= in progress) >+ `authid` bigint NOT NULL, -- reference to original authority record >+ `authid_new` bigint, -- reference to optional new authority record >+ `reportxml` text, -- xml showing original reporting tag >+ `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- date and time last modified >+ `done` tinyint DEFAULT 0 -- indication whether merge has been executed (0=not done, 1=done, 2=in progress) >+-- Note: authid and authid_new should NOT be FOREIGN keys ! >+-- authid may have been deleted; authid_new may be zero > ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; > > -- >-- >2.1.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 9988
:
59158
|
59159
|
60256
|
60257
|
60258
|
60259
|
60594
|
60595
|
60596
|
60597
|
60598
|
60599
|
60600
|
60601
|
60602
|
60603
|
60604
|
60605
|
60606
|
60607
|
60668
|
60669
|
60670
|
60671
|
60672
|
60673
|
60674
|
60675
|
61306
|
61307
|
61308
|
61309
|
61779
|
61780
|
61781
|
61782
|
61783
|
61784
|
61785
|
61786
|
61787
|
61788
|
61789
|
61790
|
61791
|
61792
|
61890
|
61891
|
61892
|
61893
|
61894
|
61895
|
61897
|
61898
|
61899
|
61900
|
61901
|
61902
|
61903
|
61904
|
61912
|
61913
|
61914
|
61915
|
61916
|
61917
|
61918
|
61919
|
61920
|
61921
|
61922
|
61923
|
61924
|
61925
|
62055
|
62123
|
62124
|
62125
|
62126
|
62127
|
62128
|
62129
|
62130
|
62131
|
62132
|
62133
|
62134
|
62135
|
62136
|
62137