The column items.ccode is 10 characters long. It references authorised values of the type CCODE. The maximum length of an authorised value is 80 characters long. If a CCODE is created with a value greater than 10, when it is stored for the item it will be truncated and become either a) an invalid ccode or b) match a different ccode! The solution should be to increase the items.ccode column from varchar(10) to varchar(80). This really goes for all columns that could possibly store an authorised value.
Created attachment 60121 [details] [review] Bug 18097 - Update kohastructure.pl
Kyle, do you plan to provide a complete patch?
(In reply to Jonathan Druart from comment #2) > Kyle, do you plan to provide a complete patch? I haven't found the time yet to identify all columns that have the option to be authorised values yet. If you want to add a patch please go ahead!
Created attachment 60656 [details] [review] Bug 18097: Add FK for authorised values
This patch seems more complicate and cover other authorised values FK. However I am wondering if ccode DB fields should have a FK as well.
It looks like we fixed this elsewhere: items.ccode is 80 chars now.
(In reply to Katrin Fischer from comment #6) > It looks like we fixed this elsewhere: items.ccode is 80 chars now. Maybe ccode, but what I tried to address (av columns) with my patch is not fixed. *** This bug has been marked as a duplicate of bug 5458 ***