[Bug 22273] New: Column article_requests.created_on should not be updated
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 Bug ID: 22273 Summary: Column article_requests.created_on should not be updated Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Database Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org Target Milestone: --- `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `updated_on` timestamp NULL DEFAULT NULL, => The update clause should not be with created_on. In addition to this, the Koha::ArticleRequest store method contains: $self->updated_on($now); This actually should not have been coded, but left to the database. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 96424 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96424&action=edit Bug 22273: Replace typo opan by opac in POD Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 96425 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96425&action=edit Bug 22273: Database revision for table article_requests Column created_on should not be updated. It is filled once by the store method of Koha::ArticleRequest. Column updated_on should be a timestamp, updated by the database. Note: Although higher versions of MySQL and MariaDB support two timestamps (NOT NULL) in one table, I kept on the safe side by allowing NULL on the created_on column. @RM: Don't forget to run DBIx update. Test plan: Run new install or upgrade. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 96426 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96426&action=edit Bug 22273: Modify Koha::ArticleRequest->store to fill created_on For a new record, store should fill created_on. The database will always update the timestamp updated_on. Since open also calls SUPER::store, we do not need to call it twice. Test plan: [1] Run t/db_dependent/ArticleRequests.t [2] In the interface, add two article requests. Change the status of one to PROCESSING. Check created_on and updated_on in the article_requests table. The changed request should have updated_on > created_on. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96424|0 |1 is obsolete| | --- Comment #4 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 99787 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99787&action=edit Bug 22273: Replace typo opan by opac in POD Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96425|0 |1 is obsolete| | --- Comment #5 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 99788 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99788&action=edit Bug 22273: Database revision for table article_requests Column created_on should not be updated. It is filled once by the store method of Koha::ArticleRequest. Column updated_on should be a timestamp, updated by the database. Note: Although higher versions of MySQL and MariaDB support two timestamps (NOT NULL) in one table, I kept on the safe side by allowing NULL on the created_on column. @RM: Don't forget to run DBIx update. Test plan: Run new install or upgrade. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Tested running update. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96426|0 |1 is obsolete| | --- Comment #6 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 99789 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99789&action=edit Bug 22273: Modify Koha::ArticleRequest->store to fill created_on For a new record, store should fill created_on. The database will always update the timestamp updated_on. Since open also calls SUPER::store, we do not need to call it twice. Test plan: [1] Run t/db_dependent/ArticleRequests.t [2] In the interface, add two article requests. Change the status of one to PROCESSING. Check created_on and updated_on in the article_requests table. The changed request should have updated_on > created_on. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> [1] Tests pass ok 12 - New article request has created_on date set ok 13 - New article request has updated_on date set [2] Work as described. No errors -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bgkriegel@gmail.com Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This works well. Should we try and fix the updated_on with the created_on on update? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|Small patch |Medium patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99787|0 |1 is obsolete| | --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 99836 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99836&action=edit Bug 22273: Replace typo opan by opac in POD Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99788|0 |1 is obsolete| | --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 99837 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99837&action=edit Bug 22273: Database revision for table article_requests Column created_on should not be updated. It is filled once by the store method of Koha::ArticleRequest. Column updated_on should be a timestamp, updated by the database. Note: Although higher versions of MySQL and MariaDB support two timestamps (NOT NULL) in one table, I kept on the safe side by allowing NULL on the created_on column. @RM: Don't forget to run DBIx update. Test plan: Run new install or upgrade. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Tested running update. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99789|0 |1 is obsolete| | --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 99838 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99838&action=edit Bug 22273: Modify Koha::ArticleRequest->store to fill created_on For a new record, store should fill created_on. The database will always update the timestamp updated_on. Since open also calls SUPER::store, we do not need to call it twice. Test plan: [1] Run t/db_dependent/ArticleRequests.t [2] In the interface, add two article requests. Change the status of one to PROCESSING. Check created_on and updated_on in the article_requests table. The changed request should have updated_on > created_on. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> [1] Tests pass ok 12 - New article request has created_on date set ok 13 - New article request has updated_on date set [2] Work as described. No errors Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Thanks Bernardo and Katrin -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #7)
This works well. Should we try and fix the updated_on with the created_on on update?
Did not think that it was so important for article requests to do so. Normally I expect these dates to be quite close to each other. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- We got quite a few reports for libraries that use article requests - was thinking more along these lines :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22273 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.05.00 |20.05.00, 19.11.05 released in| | CC| |joy@bywatersolutions.com Status|Pushed to master |Pushed to stable --- Comment #15 from Joy Nelson <joy@bywatersolutions.com> --- Pushed to 19.11.x branch for 19.11.05 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org