[SR-Users] Question on Database Version Table

Daniel-Constantin Mierla miconda at gmail.com
Tue Jun 18 22:09:56 CEST 2019


On 18.06.19 21:50, Alex Balashov wrote:
> It's probably also worth noting that Kamailio's DB layer offers
> "unpredictable" reactions to columns which are missing and which the
> given version expects to be there. 

Where did you meet such situation? A missing but expected column should
end up in an error at the sql query layer, because kamailio modules
explicitely do select/insert/... with column names.

The only unpredictable situation with some modules may be when the
column exist, but has a different type than expected. But a missing
column should be handled because of the db query error.

Cheers,
Daniel

>
> "Unpredictable" generally means a crash, but when it happens -- the
> presence of columns isn't always validated at boot time, depends on the
> module -- is the unpredictable part... 
>
> So, modernising your DB schema for built-in module tables, including
> seldom-used tables which are nevertheless formally used to back some
> module, is important when doing upgrades.
>
> On Tue, Jun 18, 2019 at 02:46:27PM -0500, JR Richardson wrote:
>
>> Yep
>> version_table
>> Set the name of the table holding the table version. Useful if the
>> proxy is sharing a database within a project and during upgrades.
>> Default value is “version”.
>> Example of usage:
>> version_table="version44"
>>
>> That's what I was looking for, perfect!
>>
>> Yes, I added accountcode and notes to my table for internal use, was
>> just making notes on columns I need on the new version upgrade.
>>
>> Thanks.
>>
>> JR
>>
>>
>> On Tue, Jun 18, 2019 at 2:17 PM Daniel-Constantin Mierla
>> <miconda at gmail.com> wrote:
>>> Hello,
>>>
>>> like Alex said, you can have two version tables, one for each versions
>>> of kamailio you play with and use in config the core parameter to set
>>> the name of that table.
>>>
>>> I am actually writing to say that address table never had accountcode
>>> and notes columns. Likely they were added in your deployment for other
>>> purposes or either the default column names were changed. The default
>>> column names are listed at:
>>>
>>>   -
>>> https://kamailio.org/docs/db-tables/kamailio-db-5.2.x.html#gen-db-address
>>>
>>> These were the same for rather long time, iirc the recent version number
>>> changed mainly due to with modifications done to the size, not due to
>>> new columns.
>>>
>>> Cheers,
>>> Daniel
>>>
>>> On 18.06.19 20:50, JR Richardson wrote:
>>>> Hey All,
>>>>
>>>> I'm doing some upgrades and noticed database table version numbers
>>>> have increased.
>>>>
>>>> database table adjustments:
>>>> | address | production ver 3 | upgrade 5.2 ver 6 | need to add
>>>> accountcode and notes column
>>>> | dispatcher | production ver 3 | upgrade 5.2 ver 4 | need to add attr column
>>>> | trusted | production ver 5 | upgrade 5.2 ver 6 | need to add
>>>> ruri_pattern and priority column
>>>>
>>>> I run mysql master/slave so I'm concerned about the master database
>>>> not having the correct version numbers or can I just update the
>>>> version number in the table when I do the upgrade of the kamailio
>>>> versions?
>>>>
>>>> Thanks.
>>>>
>>>> JR
>> _______________________________________________
>> Kamailio (SER) - Users Mailing List
>> sr-users at lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda




More information about the sr-users mailing list