[sr-dev] git:kamailio_3.0: kamctl: regenerate db creation scripts

Daniel-Constantin Mierla miconda at gmail.com
Mon Jan 4 14:36:21 CET 2010


Module: sip-router
Branch: kamailio_3.0
Commit: af5463d865bde28d1a2f977d0c9bd9347588b6e0
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=af5463d865bde28d1a2f977d0c9bd9347588b6e0

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Mon Jan  4 14:35:19 2010 +0100

kamctl: regenerate db creation scripts

---

 utils/kamctl/db_berkeley/kamailio/version |    8 ++++++
 utils/kamctl/dbtext/kamailio/version      |    4 +++
 utils/kamctl/mysql/drouting-create.sql    |   21 +++++++++++++++-
 utils/kamctl/oracle/drouting-create.sql   |   37 +++++++++++++++++++++++++++-
 utils/kamctl/postgres/drouting-create.sql |   21 +++++++++++++++-
 5 files changed, 85 insertions(+), 6 deletions(-)

diff --git a/utils/kamctl/db_berkeley/kamailio/version b/utils/kamctl/db_berkeley/kamailio/version
index cd6c6dc..88278aa 100644
--- a/utils/kamctl/db_berkeley/kamailio/version
+++ b/utils/kamctl/db_berkeley/kamailio/version
@@ -38,6 +38,14 @@ domain_name|
 domain_name|1
 domainpolicy|
 domainpolicy|2
+dr_gateways|
+dr_gateways|3
+dr_groups|
+dr_groups|2
+dr_gw_lists|
+dr_gw_lists|1
+dr_rules|
+dr_rules|3
 globalblacklist|
 globalblacklist|1
 grp|
diff --git a/utils/kamctl/dbtext/kamailio/version b/utils/kamctl/dbtext/kamailio/version
index abd03a6..685386f 100644
--- a/utils/kamctl/dbtext/kamailio/version
+++ b/utils/kamctl/dbtext/kamailio/version
@@ -14,6 +14,10 @@ dispatcher:3
 domain:1
 domain_name:1
 domainpolicy:2
+dr_gateways:3
+dr_groups:2
+dr_gw_lists:1
+dr_rules:3
 globalblacklist:1
 grp:2
 gw:10
diff --git a/utils/kamctl/mysql/drouting-create.sql b/utils/kamctl/mysql/drouting-create.sql
index 9b4388f..8f72794 100644
--- a/utils/kamctl/mysql/drouting-create.sql
+++ b/utils/kamctl/mysql/drouting-create.sql
@@ -1,14 +1,15 @@
-INSERT INTO version (table_name, table_version) values ('dr_gateways','1');
+INSERT INTO version (table_name, table_version) values ('dr_gateways','3');
 CREATE TABLE dr_gateways (
     gwid INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     type INT(11) UNSIGNED DEFAULT 0 NOT NULL,
     address VARCHAR(128) NOT NULL,
     strip INT(11) UNSIGNED DEFAULT 0 NOT NULL,
     pri_prefix VARCHAR(64) DEFAULT NULL,
+    attrs VARCHAR(255) DEFAULT NULL,
     description VARCHAR(128) DEFAULT '' NOT NULL
 ) ENGINE=MyISAM;
 
-INSERT INTO version (table_name, table_version) values ('dr_rules','1');
+INSERT INTO version (table_name, table_version) values ('dr_rules','3');
 CREATE TABLE dr_rules (
     ruleid INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     groupid VARCHAR(255) NOT NULL,
@@ -20,3 +21,19 @@ CREATE TABLE dr_rules (
     description VARCHAR(128) DEFAULT '' NOT NULL
 ) ENGINE=MyISAM;
 
+INSERT INTO version (table_name, table_version) values ('dr_gw_lists','1');
+CREATE TABLE dr_gw_lists (
+    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+    gwlist VARCHAR(255) NOT NULL,
+    description VARCHAR(128) DEFAULT '' NOT NULL
+) ENGINE=MyISAM;
+
+INSERT INTO version (table_name, table_version) values ('dr_groups','2');
+CREATE TABLE dr_groups (
+    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+    username VARCHAR(64) NOT NULL,
+    domain VARCHAR(128) DEFAULT '' NOT NULL,
+    groupid INT(11) UNSIGNED DEFAULT 0 NOT NULL,
+    description VARCHAR(128) DEFAULT '' NOT NULL
+) ENGINE=MyISAM;
+
diff --git a/utils/kamctl/oracle/drouting-create.sql b/utils/kamctl/oracle/drouting-create.sql
index a5dde37..4d2a005 100644
--- a/utils/kamctl/oracle/drouting-create.sql
+++ b/utils/kamctl/oracle/drouting-create.sql
@@ -1,10 +1,11 @@
-INSERT INTO version (table_name, table_version) values ('dr_gateways','1');
+INSERT INTO version (table_name, table_version) values ('dr_gateways','3');
 CREATE TABLE dr_gateways (
     gwid NUMBER(10) PRIMARY KEY,
     type NUMBER(10) DEFAULT 0 NOT NULL,
     address VARCHAR2(128),
     strip NUMBER(10) DEFAULT 0 NOT NULL,
     pri_prefix VARCHAR2(64) DEFAULT NULL,
+    attrs VARCHAR2(255) DEFAULT NULL,
     description VARCHAR2(128) DEFAULT ''
 );
 
@@ -16,7 +17,7 @@ END dr_gateways_tr;
 /
 BEGIN map2users('dr_gateways'); END;
 /
-INSERT INTO version (table_name, table_version) values ('dr_rules','1');
+INSERT INTO version (table_name, table_version) values ('dr_rules','3');
 CREATE TABLE dr_rules (
     ruleid NUMBER(10) PRIMARY KEY,
     groupid VARCHAR2(255),
@@ -36,3 +37,35 @@ END dr_rules_tr;
 /
 BEGIN map2users('dr_rules'); END;
 /
+INSERT INTO version (table_name, table_version) values ('dr_gw_lists','1');
+CREATE TABLE dr_gw_lists (
+    id NUMBER(10) PRIMARY KEY,
+    gwlist VARCHAR2(255),
+    description VARCHAR2(128) DEFAULT ''
+);
+
+CREATE OR REPLACE TRIGGER dr_gw_lists_tr
+before insert on dr_gw_lists FOR EACH ROW
+BEGIN
+  auto_id(:NEW.id);
+END dr_gw_lists_tr;
+/
+BEGIN map2users('dr_gw_lists'); END;
+/
+INSERT INTO version (table_name, table_version) values ('dr_groups','2');
+CREATE TABLE dr_groups (
+    id NUMBER(10) PRIMARY KEY,
+    username VARCHAR2(64),
+    domain VARCHAR2(128) DEFAULT '',
+    groupid NUMBER(10) DEFAULT 0 NOT NULL,
+    description VARCHAR2(128) DEFAULT ''
+);
+
+CREATE OR REPLACE TRIGGER dr_groups_tr
+before insert on dr_groups FOR EACH ROW
+BEGIN
+  auto_id(:NEW.id);
+END dr_groups_tr;
+/
+BEGIN map2users('dr_groups'); END;
+/
diff --git a/utils/kamctl/postgres/drouting-create.sql b/utils/kamctl/postgres/drouting-create.sql
index 4defbfe..73c2c7f 100644
--- a/utils/kamctl/postgres/drouting-create.sql
+++ b/utils/kamctl/postgres/drouting-create.sql
@@ -1,14 +1,15 @@
-INSERT INTO version (table_name, table_version) values ('dr_gateways','1');
+INSERT INTO version (table_name, table_version) values ('dr_gateways','3');
 CREATE TABLE dr_gateways (
     gwid SERIAL PRIMARY KEY NOT NULL,
     type INTEGER DEFAULT 0 NOT NULL,
     address VARCHAR(128) NOT NULL,
     strip INTEGER DEFAULT 0 NOT NULL,
     pri_prefix VARCHAR(64) DEFAULT NULL,
+    attrs VARCHAR(255) DEFAULT NULL,
     description VARCHAR(128) DEFAULT '' NOT NULL
 );
 
-INSERT INTO version (table_name, table_version) values ('dr_rules','1');
+INSERT INTO version (table_name, table_version) values ('dr_rules','3');
 CREATE TABLE dr_rules (
     ruleid SERIAL PRIMARY KEY NOT NULL,
     groupid VARCHAR(255) NOT NULL,
@@ -20,3 +21,19 @@ CREATE TABLE dr_rules (
     description VARCHAR(128) DEFAULT '' NOT NULL
 );
 
+INSERT INTO version (table_name, table_version) values ('dr_gw_lists','1');
+CREATE TABLE dr_gw_lists (
+    id SERIAL PRIMARY KEY NOT NULL,
+    gwlist VARCHAR(255) NOT NULL,
+    description VARCHAR(128) DEFAULT '' NOT NULL
+);
+
+INSERT INTO version (table_name, table_version) values ('dr_groups','2');
+CREATE TABLE dr_groups (
+    id SERIAL PRIMARY KEY NOT NULL,
+    username VARCHAR(64) NOT NULL,
+    domain VARCHAR(128) DEFAULT '' NOT NULL,
+    groupid INTEGER DEFAULT 0 NOT NULL,
+    description VARCHAR(128) DEFAULT '' NOT NULL
+);
+




More information about the sr-dev mailing list