Bug 39062

Summary: Increase length of inventory number field in database
Product: Koha Reporter: Andrew Fuerste-Henry <andrew>
Component: DatabaseAssignee: Andrew Fuerste-Henry <andrew>
Status: Pushed to main --- QA Contact: Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski>
Severity: enhancement    
Priority: P5 - low CC: dcook, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
The length of the inventory (items.stocknumber) field was increased from 32 characters to 80 characters.
Version(s) released in:
25.05.00
Circulation function:
Attachments: Bug 39062: increase length of items.stocknumber and deleteditems.stocknumber in kohastructure.sql
Bug 39062: Increase stocknumber length in items and deleteditems
Bug 39062: Increase stocknumber length in items and deleteditems
Bug 39062: increase length of items.stocknumber and deleteditems.stocknumber in kohastructure.sql
Bug 39062: Increase stocknumber length in items and deleteditems
Bug 39062: increase length of items.stocknumber and deleteditems.stocknumber in kohastructure.sql
Bug 39062: Increase stocknumber length in items and deleteditems
Bug 39062: (QA follow-up): Tidying the atomic update
Bug 39062: increase length of items.stocknumber and deleteditems.stocknumber in kohastructure.sql
Bug 39062: Increase stocknumber length in items and deleteditems
Bug 39062: (QA follow-up): Tidying the atomic update

Description Andrew Fuerste-Henry 2025-02-06 21:21:03 UTC
items.stocknumber (labeled as Inventory Number, 952$i, in edit interface) is a field that many libraries use to hold an idiosyncratic bit of local data. For such libraries, the 32 character limit can be an issue. If there's a compelling reason not to increase the size of this field, I haven't thought of or found it.
Comment 1 Andrew Fuerste-Henry 2025-02-06 21:52:31 UTC
Created attachment 177602 [details] [review]
Bug 39062: increase length of items.stocknumber and deleteditems.stocknumber in kohastructure.sql

To test:
1: try to save a value in the 952$i that is more than 32 characters
2: It does not work.
3: apply patch
4: try to save a value in the 952$i that is more than 32 characters
5: it does work!
6: delete your item and use a report to confirm the full string is in deleteditems.stocknumber
7: Maybe use DESCRIBE from mysql commandline to see the length and confirm it's changed?
Comment 2 Andrew Fuerste-Henry 2025-02-06 21:52:33 UTC
Created attachment 177603 [details] [review]
Bug 39062: Increase stocknumber length in items and deleteditems
Comment 3 Andrew Fuerste-Henry 2025-02-06 21:56:31 UTC
Created attachment 177604 [details] [review]
Bug 39062: Increase stocknumber length in items and deleteditems

But this time I spelled deleted correctly.
Comment 4 David Cook 2025-02-09 23:06:18 UTC
At a glance, I think you've accidentally obsoleted a patch you shouldn't have. I'll try to restore that...
Comment 5 Andrew Fuerste-Henry 2025-02-10 14:29:24 UTC
Created attachment 177697 [details] [review]
Bug 39062: increase length of items.stocknumber and deleteditems.stocknumber in kohastructure.sql

To test:
1: try to save a value in the 952$i that is more than 32 characters
2: It does not work.
3: apply patch
4: try to save a value in the 952$i that is more than 32 characters
5: it does work!
6: delete your item and use a report to confirm the full string is in deleteditems.stocknumber
7: Maybe use DESCRIBE from mysql commandline to see the length and confirm it's changed?
Comment 6 Andrew Fuerste-Henry 2025-02-10 14:29:26 UTC
Created attachment 177698 [details] [review]
Bug 39062: Increase stocknumber length in items and deleteditems
Comment 7 Andrew Fuerste-Henry 2025-02-10 14:38:54 UTC
(In reply to David Cook from comment #4)
> At a glance, I think you've accidentally obsoleted a patch you shouldn't
> have. I'll try to restore that...

Thanks, I think I've successfully fixed those into one patch!
Comment 8 David Cook 2025-02-10 22:30:45 UTC
(In reply to Andrew Fuerste-Henry from comment #7)
> (In reply to David Cook from comment #4)
> > At a glance, I think you've accidentally obsoleted a patch you shouldn't
> > have. I'll try to restore that...
> 
> Thanks, I think I've successfully fixed those into one patch!

Looks good!
Comment 9 David Cook 2025-02-10 23:54:37 UTC
The test report should probably mentioning needing to update the database in addition to applying the patch, but all good...
Comment 10 David Cook 2025-02-10 23:55:18 UTC
QA tools complaining about tidiness but I think we're not caring about that anymore...

 WARN   installer/data/mysql/atomicupdate/bug_39062_increase_stocknumber_length.pl
   WARN   tidiness
                The file is less tidy than before (bad/messy lines before: 0, now: 2)

 OK     installer/data/mysql/kohastructure.sql
Comment 11 David Cook 2025-02-10 23:55:47 UTC
Created attachment 177716 [details] [review]
Bug 39062: increase length of items.stocknumber and deleteditems.stocknumber in kohastructure.sql

To test:
1: try to save a value in the 952$i that is more than 32 characters
2: It does not work.
3: apply patch
4: try to save a value in the 952$i that is more than 32 characters
5: it does work!
6: delete your item and use a report to confirm the full string is in deleteditems.stocknumber
7: Maybe use DESCRIBE from mysql commandline to see the length and confirm it's changed?

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 12 David Cook 2025-02-10 23:55:49 UTC
Created attachment 177717 [details] [review]
Bug 39062: Increase stocknumber length in items and deleteditems

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 13 Marcel de Rooy 2025-03-07 08:58:03 UTC
 FAIL   installer/data/mysql/atomicupdate/bug_39062_increase_stocknumber_length.pl
   FAIL   tidiness
                File is not tidy, please run `perl misc/devel/tidy.pl installer/data/mysql/atomicupdate/bug_39062_increase_stocknumber_length.pl`
Comment 14 Andrew Fuerste-Henry 2025-03-10 13:05:31 UTC
Created attachment 179114 [details] [review]
Bug 39062: (QA follow-up): Tidying the atomic update
Comment 15 Baptiste Wojtkowski (bwoj) 2025-03-27 13:12:40 UTC
Created attachment 179793 [details] [review]
Bug 39062: increase length of items.stocknumber and deleteditems.stocknumber in kohastructure.sql

To test:
1: try to save a value in the 952$i that is more than 32 characters
2: It does not work.
3: apply patch
4: try to save a value in the 952$i that is more than 32 characters
5: it does work!
6: delete your item and use a report to confirm the full string is in deleteditems.stocknumber
7: Maybe use DESCRIBE from mysql commandline to see the length and confirm it's changed?

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 16 Baptiste Wojtkowski (bwoj) 2025-03-27 13:12:43 UTC
Created attachment 179794 [details] [review]
Bug 39062: Increase stocknumber length in items and deleteditems

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 17 Baptiste Wojtkowski (bwoj) 2025-03-27 13:12:46 UTC
Created attachment 179795 [details] [review]
Bug 39062: (QA follow-up): Tidying the atomic update

Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 18 Katrin Fischer 2025-04-22 06:42:42 UTC
Please always use the "say_success" for the success message in the database udpate!

I've also squashed the tidy patch into the previous on trying to avoid tidy only patches now.
Comment 19 Katrin Fischer 2025-04-22 06:49:58 UTC
Pushed for 25.05!

Well done everyone, thank you!