Page 1 of 1

Expanding the lead ID length

PostPosted: Tue Mar 07, 2023 6:49 pm
by RBecker
Our ViciDial instance currently has lead IDs in the 8XXXXXXXX range. Obviously we still have a long ways to go before we hit the max possible lead ID, but we are trying to prepare for the future in case we do hit that limit and need to expand our max lead ID. I can see in the database that the lead_id column in the vicidial_list table has a length of 9, but there are other lead_id columns in other tables which have a longer max length, like vicidial_recording_access_log with 10 digits, vicidial_comments with 11 digits, etc. I can very easily write a query which sweeps through all columns and updates the max length to something longer, but I want to make sure this won't break any functionality elsewhere in the system. I also don't want to introduce display issues or search issues where the full lead ID won't be able to be entered or displayed. Has anyone gone through anything similar and have experience with this?

Re: Expanding the lead ID length

PostPosted: Tue Mar 07, 2023 8:38 pm
by mflorell
The maximum value of an unsigned INT in MySQL is 4294967295, so you have quite a long way to go before you hit that. As for the '(9)' in the INT(9) field definition for "lead_id", that doesn't actually mean 9 digits, it means "For integer data types, (M) indicates the maximum display width. The maximum display width is 255. Display width is unrelated to the range of values a type can store",
https://dev.mysql.com/doc/refman/8.0/en ... yntax.html

And that doesn't even mean it actually affects the output from queries including the lead_id either, "The display width does not constrain the range of values that can be stored in the column. Nor does it prevent values wider than the column display width from being displayed correctly",
https://dev.mysql.com/doc/refman/8.0/en ... butes.html

You are at most only 21% of the way there, so you've got some time :)