Bug 39075 - Fix DB inconsistencies in the usage statistics module
Summary: Fix DB inconsistencies in the usage statistics module
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: ERM (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Matt Blenkinsop
QA Contact: Testopia
URL:
Keywords: additional_work_needed
Depends on: 34587
Blocks:
  Show dependency treegraph
 
Reported: 2025-02-10 10:27 UTC by Matt Blenkinsop
Modified: 2025-03-11 15:16 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 39075: Fix DB inconsistencies (4.21 KB, patch)
2025-02-10 10:30 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 39075: Fix DB inconsistencies (4.33 KB, patch)
2025-02-11 12:23 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 39075: (QA follow-up) Use new bug number. refer to old (1.41 KB, patch)
2025-02-11 12:23 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Blenkinsop 2025-02-10 10:27:06 UTC
Highlighted here: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34587#c38
Comment 1 Matt Blenkinsop 2025-02-10 10:30:27 UTC
Created attachment 177674 [details] [review]
Bug 39075: Fix DB inconsistencies

This patch fixes DB inconsistencies introduced in bug 34587

Test plan:
1) Run 'updatedatabase'
2) There should be no errors
3) Check the database and observe the correct assignment of the following columns
- erm_counter_logs.importdate
- erm_counter_files.date_uploaded
Comment 2 Marcel de Rooy 2025-02-11 12:23:14 UTC
Created attachment 177727 [details] [review]
Bug 39075: Fix DB inconsistencies

This patch fixes DB inconsistencies introduced in bug 34587

Test plan:
1) Run 'updatedatabase'
2) There should be no errors
3) Check the database and observe the correct assignment of the following columns
- erm_counter_logs.importdate
- erm_counter_files.date_uploaded

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] chmod 755 on new dbrev
Comment 3 Marcel de Rooy 2025-02-11 12:23:17 UTC
Created attachment 177728 [details] [review]
Bug 39075: (QA follow-up) Use new bug number. refer to old

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2025-02-11 12:24:42 UTC
Thanks Matt.
Trivial. SO and QA in one pass.
Comment 5 Katrin Fischer 2025-02-27 16:33:19 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 6 Katrin Fischer 2025-02-27 16:51:39 UTC
Pondering if this is an enh or a bugfix?
Comment 7 Jonathan Druart 2025-03-11 15:16:17 UTC
https://jenkins.koha-community.org/job/Koha_Main_MariaDB_update/78/console

16:08:12 koha_1       | +++ b/Koha/Schema/Result/ErmCounterFile.pm
16:08:12 koha_1       | @@ -67,7 +67,7 @@ content of the counter file
16:08:12 koha_1       |    data_type: 'timestamp'
16:08:12 koha_1       |    datetime_undef_if_invalid: 1
16:08:12 koha_1       |    default_value: current_timestamp
16:08:12 koha_1       | -  is_nullable: 1
16:08:12 koha_1       | +  is_nullable: 0
16:08:12 koha_1       |  
16:08:12 koha_1       |  counter file upload date
16:08:12 koha_1       |  
16:08:12 koha_1       | @@ -89,7 +89,7 @@ __PACKAGE__->add_columns(
16:08:12 koha_1       |      data_type => "timestamp",
16:08:12 koha_1       |      datetime_undef_if_invalid => 1,
16:08:12 koha_1       |      default_value => \"current_timestamp",
16:08:12 koha_1       | -    is_nullable => 1,
16:08:12 koha_1       | +    is_nullable => 0,

The db rev is missing the NULL