Module: sip-router
Branch: master
Commit: aba560469218f5cc80b5084a5038bfdaecab493e
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=aba5604…
Author: Raul Alexis Betancor Santana <rabs(a)dimension-virtual.com>
Committer: Raul Alexis Betancor Santana <rabs(a)dimension-virtual.com>
Date: Sun Jan 3 16:55:28 2010 +0000
modules_k/drouting: Update SQL files
- Updated SQL files, created from make dbschema
---
utils/kamctl/mysql/drouting-create.sql | 25 +++++++++++++++---
utils/kamctl/oracle/drouting-create.sql | 41 ++++++++++++++++++++++++++---
utils/kamctl/postgres/drouting-create.sql | 25 +++++++++++++++---
3 files changed, 79 insertions(+), 12 deletions(-)
diff --git a/utils/kamctl/mysql/drouting-create.sql
b/utils/kamctl/mysql/drouting-create.sql
index 9b4388f..aac0da3 100644
--- a/utils/kamctl/mysql/drouting-create.sql
+++ b/utils/kamctl/mysql/drouting-create.sql
@@ -1,22 +1,39 @@
-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,
+ pri_prefix VARCHAR(16) 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,
prefix VARCHAR(64) NOT NULL,
timerec VARCHAR(255) NOT NULL,
priority INT(11) DEFAULT 0 NOT NULL,
- routeid VARCHAR(64) NOT NULL,
+ routeid VARCHAR(255) NOT NULL,
gwlist VARCHAR(255) NOT NULL,
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..e52cdba 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,
+ pri_prefix VARCHAR2(16) DEFAULT NULL,
+ attrs VARCHAR2(255) DEFAULT NULL,
description VARCHAR2(128) DEFAULT ''
);
@@ -16,14 +17,14 @@ 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),
prefix VARCHAR2(64),
timerec VARCHAR2(255),
priority NUMBER(10) DEFAULT 0 NOT NULL,
- routeid VARCHAR2(64),
+ routeid VARCHAR2(255),
gwlist VARCHAR2(255),
description VARCHAR2(128) DEFAULT ''
);
@@ -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..1a02c6b 100644
--- a/utils/kamctl/postgres/drouting-create.sql
+++ b/utils/kamctl/postgres/drouting-create.sql
@@ -1,22 +1,39 @@
-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,
+ pri_prefix VARCHAR(16) 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,
prefix VARCHAR(64) NOT NULL,
timerec VARCHAR(255) NOT NULL,
priority INTEGER DEFAULT 0 NOT NULL,
- routeid VARCHAR(64) NOT NULL,
+ routeid VARCHAR(255) NOT NULL,
gwlist VARCHAR(255) NOT NULL,
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
+);
+