[sr-dev] git:kamailio_3.0: kamctl: added new db table definitions
Daniel-Constantin Mierla
miconda at gmail.com
Sun Jan 3 13:32:38 CET 2010
Module: sip-router
Branch: kamailio_3.0
Commit: 0292a4b5f2cb0564649699c592e51a06edbd91a4
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0292a4b5f2cb0564649699c592e51a06edbd91a4
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: Sun Jan 3 13:31:23 2010 +0100
kamctl: added new db table definitions
- sql to create drouting tables for mysql, postgres and oracle
---
utils/kamctl/mysql/drouting-create.sql | 22 ++++++++++++++++
utils/kamctl/oracle/drouting-create.sql | 38 +++++++++++++++++++++++++++++
utils/kamctl/postgres/drouting-create.sql | 22 ++++++++++++++++
3 files changed, 82 insertions(+), 0 deletions(-)
diff --git a/utils/kamctl/mysql/drouting-create.sql b/utils/kamctl/mysql/drouting-create.sql
new file mode 100644
index 0000000..9b4388f
--- /dev/null
+++ b/utils/kamctl/mysql/drouting-create.sql
@@ -0,0 +1,22 @@
+INSERT INTO version (table_name, table_version) values ('dr_gateways','1');
+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,
+ description VARCHAR(128) DEFAULT '' NOT NULL
+) ENGINE=MyISAM;
+
+INSERT INTO version (table_name, table_version) values ('dr_rules','1');
+CREATE TABLE dr_rules (
+ ruleid INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ groupid VARCHAR(255) NOT NULL,
+ prefix VARCHAR(64) NOT NULL,
+ timerec VARCHAR(255) NOT NULL,
+ priority INT(11) DEFAULT 0 NOT NULL,
+ routeid VARCHAR(64) NOT NULL,
+ gwlist VARCHAR(255) 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
new file mode 100644
index 0000000..a5dde37
--- /dev/null
+++ b/utils/kamctl/oracle/drouting-create.sql
@@ -0,0 +1,38 @@
+INSERT INTO version (table_name, table_version) values ('dr_gateways','1');
+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,
+ description VARCHAR2(128) DEFAULT ''
+);
+
+CREATE OR REPLACE TRIGGER dr_gateways_tr
+before insert on dr_gateways FOR EACH ROW
+BEGIN
+ auto_id(:NEW.id);
+END dr_gateways_tr;
+/
+BEGIN map2users('dr_gateways'); END;
+/
+INSERT INTO version (table_name, table_version) values ('dr_rules','1');
+CREATE TABLE dr_rules (
+ ruleid NUMBER(10) PRIMARY KEY,
+ groupid VARCHAR2(255),
+ prefix VARCHAR2(64),
+ timerec VARCHAR2(255),
+ priority NUMBER(10) DEFAULT 0 NOT NULL,
+ routeid VARCHAR2(64),
+ gwlist VARCHAR2(255),
+ description VARCHAR2(128) DEFAULT ''
+);
+
+CREATE OR REPLACE TRIGGER dr_rules_tr
+before insert on dr_rules FOR EACH ROW
+BEGIN
+ auto_id(:NEW.id);
+END dr_rules_tr;
+/
+BEGIN map2users('dr_rules'); END;
+/
diff --git a/utils/kamctl/postgres/drouting-create.sql b/utils/kamctl/postgres/drouting-create.sql
new file mode 100644
index 0000000..4defbfe
--- /dev/null
+++ b/utils/kamctl/postgres/drouting-create.sql
@@ -0,0 +1,22 @@
+INSERT INTO version (table_name, table_version) values ('dr_gateways','1');
+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,
+ description VARCHAR(128) DEFAULT '' NOT NULL
+);
+
+INSERT INTO version (table_name, table_version) values ('dr_rules','1');
+CREATE TABLE dr_rules (
+ ruleid SERIAL PRIMARY KEY NOT NULL,
+ groupid VARCHAR(255) NOT NULL,
+ prefix VARCHAR(64) NOT NULL,
+ timerec VARCHAR(255) NOT NULL,
+ priority INTEGER DEFAULT 0 NOT NULL,
+ routeid VARCHAR(64) NOT NULL,
+ gwlist VARCHAR(255) NOT NULL,
+ description VARCHAR(128) DEFAULT '' NOT NULL
+);
+
More information about the sr-dev
mailing list