Bug 19724

Summary: Add timestamp to biblio_metadata and deletedbiblio_metadata
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: DatabaseAssignee: Julian Maurice <julian.maurice>
Status: CLOSED FIXED QA Contact: Josef Moravec <josef.moravec>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, josef.moravec, magnus, nick
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Who signed the patch off: Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17196    
Bug Blocks: 19725, 19730    
Attachments: Bug 19724: Add timestamp to biblio_metadata and deletedbiblio_metadata
Bug 19724: Add timestamp to biblio_metadata and deletedbiblio_metadata
Bug 19724: Add timestamp to biblio_metadata and deletedbiblio_metadata

Description Julian Maurice 2017-12-01 13:01:55 UTC
Since bug 17196, biblioitems.timestamp is not always updated after a
change in the MARC record.
We need to know the last modification time of the MARC record for some
features (like OAI-PMH parameters 'from' and 'until' for instance)
Comment 1 Julian Maurice 2017-12-01 13:03:10 UTC
Created attachment 69431 [details] [review]
Bug 19724: Add timestamp to biblio_metadata and deletedbiblio_metadata

Since bug 17196, biblioitems.timestamp is not always updated after a
change in the MARC record.
We need to know the last modification time of the MARC record for some
features (like OAI-PMH parameters 'from' and 'until' for instance)

This patch only adds the missing column in biblio_metadata and
deletedbiblio_metadata

Test plan:
1. Run updatedatabase.pl
2. Verify that both tables have the new column, its value should be the
   greatest timestamp value from the corresponding biblio and
   biblioitems table entries
   You can verify with the following SQL query:
     SELECT b.biblionumber, b.timestamp as biblio_ts,
     bi.timestamp as biblioitems_ts, m.timestamp as biblio_metadata_ts
     FROM biblio_metadata m
     LEFT JOIN biblioitems bi ON (bi.biblionumber = m.biblionumber)
     LEFT JOIN biblio b ON (b.biblionumber = m.biblionumber);
Comment 2 David Bourgault 2017-12-01 20:23:43 UTC
Created attachment 69457 [details] [review]
Bug 19724: Add timestamp to biblio_metadata and deletedbiblio_metadata

Since bug 17196, biblioitems.timestamp is not always updated after a
change in the MARC record.
We need to know the last modification time of the MARC record for some
features (like OAI-PMH parameters 'from' and 'until' for instance)

This patch only adds the missing column in biblio_metadata and
deletedbiblio_metadata

Test plan:
1. Run updatedatabase.pl
2. Verify that both tables have the new column, its value should be the
   greatest timestamp value from the corresponding biblio and
   biblioitems table entries
   You can verify with the following SQL query:
     SELECT b.biblionumber, b.timestamp as biblio_ts,
     bi.timestamp as biblioitems_ts, m.timestamp as biblio_metadata_ts
     FROM biblio_metadata m
     LEFT JOIN biblioitems bi ON (bi.biblionumber = m.biblionumber)
     LEFT JOIN biblio b ON (b.biblionumber = m.biblionumber);

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Comment 3 Magnus Enger 2017-12-04 08:08:54 UTC
*** Bug 19555 has been marked as a duplicate of this bug. ***
Comment 4 Josef Moravec 2017-12-04 10:58:19 UTC
Created attachment 69478 [details] [review]
Bug 19724: Add timestamp to biblio_metadata and deletedbiblio_metadata

Since bug 17196, biblioitems.timestamp is not always updated after a
change in the MARC record.
We need to know the last modification time of the MARC record for some
features (like OAI-PMH parameters 'from' and 'until' for instance)

This patch only adds the missing column in biblio_metadata and
deletedbiblio_metadata

Test plan:
1. Run updatedatabase.pl
2. Verify that both tables have the new column, its value should be the
   greatest timestamp value from the corresponding biblio and
   biblioitems table entries
   You can verify with the following SQL query:
     SELECT b.biblionumber, b.timestamp as biblio_ts,
     bi.timestamp as biblioitems_ts, m.timestamp as biblio_metadata_ts
     FROM biblio_metadata m
     LEFT JOIN biblioitems bi ON (bi.biblionumber = m.biblionumber)
     LEFT JOIN biblio b ON (b.biblionumber = m.biblionumber);

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 5 Josef Moravec 2017-12-04 11:08:13 UTC
QA Comment: the function GREATEST is not "standard" but is widely implemented, so no problem here in my opinion
Comment 6 Jonathan Druart 2017-12-07 14:24:44 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 7 Nick Clemens 2017-12-14 12:34:15 UTC
Pushed to stable for 17.11.01, awesome work all!
Comment 8 Fridolin SOMERS 2017-12-20 11:26:29 UTC
(In reply to Nick Clemens from comment #7)
> Pushed to stable for 17.11.01, awesome work all!

Your commit in 17.11.x is missing the update of version in Koha.pm
Comment 9 Fridolin SOMERS 2017-12-20 11:26:40 UTC
Pushed to 17.05.x, will be in v17.05.07
Comment 10 Fridolin SOMERS 2018-01-19 08:46:50 UTC
Resolved since Bug 17196 not in 16.11.x