Bug 13539 - Table patroncards not used
Summary: Table patroncards not used
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Database (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-08 15:37 UTC by Katrin Fischer
Modified: 2015-12-03 22:11 UTC (History)
1 user (show)

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


Attachments
Bug 13539 - Remove unused table patroncards (2.32 KB, patch)
2015-01-18 21:46 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 13539 - Remove unused table patroncards (2.39 KB, patch)
2015-02-25 05:24 UTC, Brendan Gallagher
Details | Diff | Splinter Review
Bug 13539 - Remove unused table patroncards (2.44 KB, patch)
2015-02-25 10:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 13539: (RM followup) DBIx schema update (3.72 KB, patch)
2015-04-13 16:26 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2015-01-08 15:37:30 UTC
It appears that creating patroncard batches and printing those is not adding data to the patroncards table, but the creator_batches table is used for storing the information.

Looking and searching the code I couldn't find where data is inserted in the patroncards table - is it possible the table is no longer in use? Maybe since the rewrite of the label creators?
Comment 1 Chris Nighswonger 2015-01-08 17:00:43 UTC
<chris_n> hmm... that table appears to be vestigial
<chris_n> mysql> SELECT count(*) FROM patroncards;
<chris_n> +----------+
<chris_n> | count(*) |
<chris_n> +----------+
<chris_n> |        5 |
<chris_n> +----------+
<chris_n> 1 row in set (0.00 sec)
<chris_n> but the timestamps are from 2008
<chris_n> and grep shows no code referencing that table

And so this table may safetly be removed, IMHO.
Comment 2 Katrin Fischer 2015-01-18 21:46:42 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2015-01-18 21:48:54 UTC
I'd consider the batch data kind of temporary as it's only needed for printing.
There is no way to clean out the old data from within Koha and it's not been accessible in the GUI apart from reports for a long time. 

If someone sees a reason to be more careful here, please comment :)
Comment 4 Katrin Fischer 2015-01-18 21:50:54 UTC
Test plan:

- Check the table exists in your database
- Run the database update
- Confirm the table has been deleted
- Verify the table is not necessary for printing patroncards 
  (using the feature and/or checking the codebase)
- Make sure the web installer still works correctly on creating a new database,
  but that patroncards is no longer created
Comment 5 Brendan Gallagher 2015-02-25 05:24:31 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-02-25 10:44:37 UTC
Created attachment 36158 [details] [review]
Bug 13539 - Remove unused table patroncards

It appears that the table patroncards hasn't been used
since the database updates for the rewritten label modules
('3.01.00.107').

It's time to remove them from the database.

As the patron card batches were needed for printing and
the data has not been accessible in a long time, it seems safe
to delete it.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 7 Tomás Cohen Arazi 2015-04-13 16:26:33 UTC
Created attachment 37769 [details] [review]
Bug 13539: (RM followup) DBIx schema update

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Comment 8 Tomás Cohen Arazi 2015-04-13 16:32:58 UTC
Patch pushed to master.

Thanks Katrina!