[Bug 11165] New: datecreated and datemodified column in auth_header
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 Bug ID: 11165 Summary: datecreated and datemodified column in auth_header Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Database Assignee: gmcharlt@gmail.com Reporter: fridolyn.somers@biblibre.com QA Contact: testopia@bugs.koha-community.org In auth_header table has columns datecreated and datemodified. Those columns are never filled by code. Should they be managed by database ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- datecreated is set in C4::AuthoritiesMarc::AddAuthority: 694 my $sth=$dbh->prepare("insert into auth_header (authid,datecreated,authtypecode,marc,marcxml) values (?,now(),?,?,?)"); -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 34330 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34330&action=edit Bug 11165: Automatically save the authority last modification time This patch rename the column auth_header.datemodified with modification_time. Now this column will be automatically updated when a row will be updated. Test plan: 0/ Verify that la major part of your auth_header.datemodified is set to null 1/ Execute the updatedb entry 2/ Verify that the column is renamed and the values is set to now (something better to suggest?) 3/ Update an authority and verify (using the sql cli) that this value has been updated. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Assignee|gmcharlt@gmail.com |jonathan.druart@biblibre.co | |m Summary|datecreated and |auth_header.datemodified |datemodified column in |should be updated |auth_header | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Status|Needs Signoff |Failed QA --- Comment #3 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- What about: Koha/Schema/Result/AuthHeader.pm: "datemodified", installer/data/mysql/kohastructure.sql: `datemodified` date default NULL, Also I do not like the update of datemodified when running the dbrev. If you rename the column and add the 'on update' clause later, you should be able to prevent that. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #34330|0 |1 is obsolete| | --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 36999 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36999&action=edit Bug 11165: Automatically save the authority last modification time This patch rename the column auth_header.datemodified with modification_time. Now this column will be automatically updated when a row will be updated. Test plan: 0/ Verify that la major part of your auth_header.datemodified is set to null 1/ Execute the updatedb entry 2/ Verify that the column is renamed and the values is set to now (something better to suggest?) 3/ Update an authority and verify (using the sql cli) that this value has been updated. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36999|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 37000 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37000&action=edit Bug 11165: Automatically save the authority last modification time This patch rename the column auth_header.datemodified with modification_time. Now this column will be automatically updated when a row will be updated. Test plan: 0/ Verify that la major part of your auth_header.datemodified is set to null 1/ Execute the updatedb entry 2/ Verify that the column is renamed and the values have not been changed. 3/ Update an authority and verify (using the sql cli) that this value has been updated. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to M. de Rooy from comment #3)
What about: Koha/Schema/Result/AuthHeader.pm: "datemodified", installer/data/mysql/kohastructure.sql: `datemodified` date default NULL,
Oops! The schema file will be updated by the RM.
Also I do not like the update of datemodified when running the dbrev. If you rename the column and add the 'on update' clause later, you should be able to prevent that.
Ho good catch, I have just tried and it seems to work! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37000|0 |1 is obsolete| | --- Comment #7 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 37006 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37006&action=edit Bug 11165: Automatically save the authority last modification time This patch rename the column auth_header.datemodified with modification_time. Now this column will be automatically updated when a row will be updated. Test plan: 0/ Verify that la major part of your auth_header.datemodified is set to null 1/ Execute the updatedb entry 2/ Verify that the column is renamed and the values have not been changed. 3/ Update an authority and verify (using the sql cli) that this value has been updated. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> In the absence of a coding guideline stipulating a preferred column name for a timestamp, this modification_time works for me. Null values are replaced by current time after db rev; other values are left alone. NOTE FOR RM: Please run update_dbix_class_files.pl. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37006|0 |1 is obsolete| | --- Comment #8 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 38026 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38026&action=edit [PASSED QA] Bug 11165: Automatically save the authority last modification time This patch rename the column auth_header.datemodified with modification_time. Now this column will be automatically updated when a row will be updated. Test plan: 0/ Verify that la major part of your auth_header.datemodified is set to null 1/ Execute the updatedb entry 2/ Verify that the column is renamed and the values have not been changed. 3/ Update an authority and verify (using the sql cli) that this value has been updated. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> In the absence of a coding guideline stipulating a preferred column name for a timestamp, this modification_time works for me. Null values are replaced by current time after db rev; other values are left alone. NOTE FOR RM: Please run update_dbix_class_files.pl. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Jonathan! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11165 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|auth_header.datemodified |Save and update |should be updated |auth_header.modification_ti | |me Component|Database |Cataloging CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org