Summary: | Deleting a request does not delete its log entries | ||
---|---|---|---|
Product: | Koha | Reporter: | Andrew Isherwood <bugzilla> |
Component: | ILL | Assignee: | Bugs List <koha-bugs> |
Status: | CLOSED WONTFIX | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | ||
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32630 | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 21810 | ||
Bug Blocks: |
Description
Andrew Isherwood
2018-11-12 14:28:14 UTC
Would one option be to not reuse the ID? Or have a real PK that is used instead of the ID used? illrequests.illrequest_id is an auto_increment column, which is inline with the vast majority of primary key columns in Koha. Googling around suggests that MySQL/MariaDB shouldn't reuse deleted values in auto_increment columns, which was always my understanding also. However, I'm seeing log entries associated with requests where the log entries are dated before the request was created. My assumption was that IDs were being re-used, though, I have failed to replicate that behaviour. So perhaps the problem is not caused by that after all. I believe though that the bug is still valid. If a request is deleted, its log entries should be also. Due to the inability to create a foreign key on action_logs.object (due it potentially referring to many different keys), and therefore the inability to create a cascade, I believe we should do this cleanup manually. I believe this might be a WONTFIX since we never clean up action_logs if something is deleted (the action_logs usually also contain the information, that something WAS deleted in the first place). Then you can use cleanup_database.pl to clean action_logs: https://git.koha-community.org/Koha-community/Koha/src/branch/master/misc/cronjobs/cleanup_database.pl --log-modules Specify which action log modules to trim. Repeatable. --preserve-log Specify which action logs to exclude. Repeatable. --logs DAYS purge entries from action_logs older than DAYS days. Defaults to 180 days if no days specified. |