Bug 13539

Summary: Table patroncards not used
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: DatabaseAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 13539 - Remove unused table patroncards
Bug 13539 - Remove unused table patroncards
Bug 13539 - Remove unused table patroncards
Bug 13539: (RM followup) DBIx schema update

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 (tcohen) 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 (tcohen) 2015-04-13 16:32:58 UTC
Patch pushed to master.

Thanks Katrina!