[sr-dev] git:master: srdb1/dbschema: regenerated db creation scripts

Daniel-Constantin Mierla miconda at gmail.com
Tue May 22 13:36:40 CEST 2012


Hello,
On 5/22/12 1:02 PM, Andreas Granig wrote:
> Hi,
>
> How does the generation of db creation scripts actually work? In the
> past, I manually adapted all the files, which seemed pretty pointless
> due to the existence of the xml definitions.
once you modify the xml files in lib/srdb1/schema/ run:

make dbschema

Do it in the main folder with sources. It will regenerate affected 
scripts used by kamdbctl


>
> So is there a make target or a script for that? Will this support all
> existing db backends?

Yes, it should be valid for all db connectors developed through kamailio 
branch in the past.

>
> And what's the difference between lib/srdb1/schema and lib/srdb2/schema?

srdb2 is the db api used by modules developed via ser branch in the 
past, there should be the database structures for modules_s.

Cheers,
Daniel

>
> Thanks for clarification,
> Andreas
>
> On 05/22/2012 12:43 PM, Daniel-Constantin Mierla wrote:
>> Module: sip-router
>> Branch: master
>> Commit: 861603806e72876e0348c25031bcd64892023a20
>> URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=861603806e72876e0348c25031bcd64892023a20
>>
>> Author: Daniel-Constantin Mierla <miconda at gmail.com>
>> Committer: Daniel-Constantin Mierla <miconda at gmail.com>
>> Date:   Tue May 22 12:41:05 2012 +0200
>>
>> srdb1/dbschema: regenerated db creation scripts
>>
>> - lcr_rule version update was not taken in consideration
>> - reported by Timo Teräs
>>
>> ---
>>
>>   utils/kamctl/db_berkeley/kamailio/version |    2 +-
>>   utils/kamctl/db_sqlite/lcr-create.sql     |    2 +-
>>   utils/kamctl/dbtext/kamailio/version      |    2 +-
>>   utils/kamctl/mysql/lcr-create.sql         |    2 +-
>>   utils/kamctl/oracle/lcr-create.sql        |    2 +-
>>   utils/kamctl/postgres/lcr-create.sql      |    2 +-
>>   6 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/utils/kamctl/db_berkeley/kamailio/version b/utils/kamctl/db_berkeley/kamailio/version
>> index 235d82b..c51ace4 100644
>> --- a/utils/kamctl/db_berkeley/kamailio/version
>> +++ b/utils/kamctl/db_berkeley/kamailio/version
>> @@ -63,7 +63,7 @@ imc_rooms|1
>>   lcr_gw|
>>   lcr_gw|2
>>   lcr_rule|
>> -lcr_rule|1
>> +lcr_rule|2
>>   lcr_rule_target|
>>   lcr_rule_target|1
>>   location|
>> diff --git a/utils/kamctl/db_sqlite/lcr-create.sql b/utils/kamctl/db_sqlite/lcr-create.sql
>> index 8493e26..63eb37d 100644
>> --- a/utils/kamctl/db_sqlite/lcr-create.sql
>> +++ b/utils/kamctl/db_sqlite/lcr-create.sql
>> @@ -31,7 +31,7 @@ CREATE TABLE lcr_rule_target (
>>   
>>   CREATE INDEX lcr_rule_target_lcr_id_idx ON lcr_rule_target (lcr_id);
>>   
>> -INSERT INTO version (table_name, table_version) values ('lcr_rule','1');
>> +INSERT INTO version (table_name, table_version) values ('lcr_rule','2');
>>   CREATE TABLE lcr_rule (
>>       id INTEGER PRIMARY KEY NOT NULL,
>>       lcr_id SMALLINT NOT NULL,
>> diff --git a/utils/kamctl/dbtext/kamailio/version b/utils/kamctl/dbtext/kamailio/version
>> index 31bf74b..0396a99 100644
>> --- a/utils/kamctl/dbtext/kamailio/version
>> +++ b/utils/kamctl/dbtext/kamailio/version
>> @@ -26,7 +26,7 @@ htable:2
>>   imc_members:1
>>   imc_rooms:1
>>   lcr_gw:2
>> -lcr_rule:1
>> +lcr_rule:2
>>   lcr_rule_target:1
>>   location:5
>>   matrix:1
>> diff --git a/utils/kamctl/mysql/lcr-create.sql b/utils/kamctl/mysql/lcr-create.sql
>> index f7dbf26..efa65b2 100644
>> --- a/utils/kamctl/mysql/lcr-create.sql
>> +++ b/utils/kamctl/mysql/lcr-create.sql
>> @@ -31,7 +31,7 @@ CREATE TABLE lcr_rule_target (
>>   
>>   CREATE INDEX lcr_id_idx ON lcr_rule_target (lcr_id);
>>   
>> -INSERT INTO version (table_name, table_version) values ('lcr_rule','1');
>> +INSERT INTO version (table_name, table_version) values ('lcr_rule','2');
>>   CREATE TABLE lcr_rule (
>>       id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
>>       lcr_id SMALLINT UNSIGNED NOT NULL,
>> diff --git a/utils/kamctl/oracle/lcr-create.sql b/utils/kamctl/oracle/lcr-create.sql
>> index 530a798..5fe88a0 100644
>> --- a/utils/kamctl/oracle/lcr-create.sql
>> +++ b/utils/kamctl/oracle/lcr-create.sql
>> @@ -47,7 +47,7 @@ BEGIN map2users('lcr_rule_target'); END;
>>   /
>>   CREATE INDEX lcr_rule_target_lcr_id_idx  ON lcr_rule_target (lcr_id);
>>   
>> -INSERT INTO version (table_name, table_version) values ('lcr_rule','1');
>> +INSERT INTO version (table_name, table_version) values ('lcr_rule','2');
>>   CREATE TABLE lcr_rule (
>>       id NUMBER(10) PRIMARY KEY,
>>       lcr_id NUMBER(5),
>> diff --git a/utils/kamctl/postgres/lcr-create.sql b/utils/kamctl/postgres/lcr-create.sql
>> index 52f51c5..958213a 100644
>> --- a/utils/kamctl/postgres/lcr-create.sql
>> +++ b/utils/kamctl/postgres/lcr-create.sql
>> @@ -31,7 +31,7 @@ CREATE TABLE lcr_rule_target (
>>   
>>   CREATE INDEX lcr_rule_target_lcr_id_idx ON lcr_rule_target (lcr_id);
>>   
>> -INSERT INTO version (table_name, table_version) values ('lcr_rule','1');
>> +INSERT INTO version (table_name, table_version) values ('lcr_rule','2');
>>   CREATE TABLE lcr_rule (
>>       id SERIAL PRIMARY KEY NOT NULL,
>>       lcr_id SMALLINT NOT NULL,
>>
>>
>> _______________________________________________
>> sr-dev mailing list
>> sr-dev at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20120522/e53c2bb9/attachment-0001.htm>


More information about the sr-dev mailing list