Bug 7718

Summary: Remove itemnumber column from serials table
Product: Koha Reporter: Nicole C. Engard <nengard>
Component: SerialsAssignee: Kyle M Hall <kyle.m.hall>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: normal    
Priority: P5 - low CC: bgkriegel, chris, gmcharlt, jonathan.druart, kyle.m.hall, kyle, m.de.rooy
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Who signed the patch off: Text to go in the release notes:
Version(s) released in:
Attachments: Bug 7718 - itemnumber not populated in the serial table
Bug 7718 - Remove itemnumber column from serials table
Bug 7718 - Remove itemnumber column from serials table
[SIGNED-OFF] Bug 7718 - Remove itemnumber column from serials table
Bug 7718 - Remove itemnumber column from serials table

Description Nicole C. Engard 2012-03-14 18:05:09 UTC
If you add items when receiving serials the itemnumber is not put in the serial table even though there is a field for it.  This field should be populated.
Comment 1 Kyle M Hall 2012-04-11 15:14:56 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2012-04-11 15:15:55 UTC
Assuming this patch is pushed to master, is there any reason we should not phase out the serialitems table?
Comment 3 Jared Camins-Esakov 2012-05-13 11:29:09 UTC
(In reply to comment #2)
> Assuming this patch is pushed to master, is there any reason we should not
> phase out the serialitems table?

Yes, serials:items is a 1:many relationship. It seems to me that the correct solution here is not to populate serial.itemnumber, but rather to remove it so that no one thinks that they should be using it.
Comment 4 Chris Cormack 2012-05-19 09:43:08 UTC
I agree, removing the column instead of filling it is a better solution
Comment 5 Kyle M Hall 2013-02-04 13:21:25 UTC Comment hidden (obsolete)
Comment 6 Owen Leonard 2013-02-05 17:28:14 UTC
This patch recycles the database upgrade description from another update ("Add IDreamBooks enhanced content") and lacks a test plan.
Comment 7 Kyle M Hall 2013-02-05 20:02:19 UTC Comment hidden (obsolete)
Comment 8 Jared Camins-Esakov 2013-02-05 20:10:04 UTC
The test plan needs to provide enough information for the tester to confirm that the removal of the column does not break anything.
Comment 9 Bernardo Gonzalez Kriegel 2013-02-05 20:12:34 UTC Comment hidden (obsolete)
Comment 10 Bernardo Gonzalez Kriegel 2013-02-05 20:30:44 UTC
(In reply to comment #8)
> The test plan needs to provide enough information for the tester to confirm
> that the removal of the column does not break anything.

I did a check. Can't found any SELECT, DELETE or INSERT that
references itemnumber column from serial table.
But I may be wrong.
Comment 11 Jonathan Druart 2013-05-22 10:40:57 UTC
QA comment:

This patch removes a useless (since the table serialitems exist) column.
I agree with Bernardo, I did not find any occurrence of this column.

Marked as Passed QA.
Comment 12 Jonathan Druart 2013-05-22 10:41:25 UTC
Created attachment 18304 [details] [review]
Bug 7718 - Remove itemnumber column from serials table

Remove the column 'itemnumber' from the table 'serial'. This is
a 1 to many relationship, and this reference does not make sense.
The 'serialitems' table handles the relationship between the 'items'
table and the 'serial' table.

Test Plan:
1) Apply patch
2) Run updatedatabase.pl
3) Verify serial.itemnumber has been removed from the database

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Column removed. No errors.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 13 Galen Charlton 2013-05-22 15:54:25 UTC
Pushed to master.  Thanks, Kyle!

As a historical note, the serialitems table was added back in 2008.  There was an upgrade concern that apparently prevented serial.itemnumber from being removed at the time that serialitems was added, but the code behind that that used to put a comma-separated list of itemnumbers into serial.itemnumber has long since been removed.
Comment 14 Marcel de Rooy 2013-06-05 13:10:53 UTC
(In reply to comment #3)
> Yes, serials:items is a 1:many relationship. It seems to me that the correct
> solution here is not to populate serial.itemnumber, but rather to remove it
> so that no one thinks that they should be using it.

Jared:
Could you tell me how I can create more than one item for one serial record?
It just looks like a 1:1 relationship.

Note that the table name serial is somewhat misleading. It actually is some kind of "subscription item".
The relation between calling AddItem2Serial and NewIssue is not very clear in the current Koha code.

If this is just 1:1, it would not have been a bad idea to remove the serialitems table? If it is not, I am even more interested..

Thanks.