Hi, 

I added two scripts 
1- to create tables 
2- Insert some basic data in address table

Statement 1 executed and tables created but second .sql file not executed although it showed in logs. What shall I do to insert some basic data?

Thanks.

On Thursday, November 5, 2020, 07:03:04 PM GMT+5, me.projects@yahoo.com <me.projects@yahoo.com> wrote:


Hi,

Thanks for your reply. Some times we need to provide Initial Data in some tables so I think we can use something you suggested. 

On Thursday, November 5, 2020, 06:00:23 PM GMT+5, Daniel-Constantin Mierla <miconda@gmail.com> wrote:


Hello,

if you put the sql to create the table in share/kamailio/mysql/customtable-create.sql

then you can run:

kamdbctl add-tables customtable

This has to be done after the kamdbctl create command.

If you plan for long term, also taking in consideration the option to add management of customtable records in the cli, I can recommend to look at kamcli:


It can also create the customtable using:

kamcli db create-tables-group customtable

The 'kamcli db' offers what old 'kamdbctl' and 'kamctl db ...' do.

But then you can just add your own python file in 'kamcli/commands/cmd_customtable.py' to manage records in that table (for example, you can use cmd_aliasdb.py as a starting point).

Cheers,
Daniel

On 05.11.20 13:40, me.projects@yahoo.com wrote:
Hi,

I want add some custom Table Creation during installation of Kamailio. 

I want to add my Custom Table during the execution of 

kamdbctl create

command. Currently I am adding my script in 

share/kamailio/mysql/auth_db-create.sql

Thanks,

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@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
Funding: https://www.paypal.me/dcmierla