[sr-dev] git:master: kamctl: added mtree sql scripts
Daniel-Constantin Mierla
miconda at gmail.com
Thu Jan 28 18:58:08 CET 2010
Module: sip-router
Branch: master
Commit: a5763a67a53fd3e33dc75cc7b2b3870caad5f4d1
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a5763a67a53fd3e33dc75cc7b2b3870caad5f4d1
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: Thu Jan 28 18:57:39 2010 +0100
kamctl: added mtree sql scripts
---
utils/kamctl/mysql/mtree-create.sql | 8 ++++++++
utils/kamctl/oracle/mtree-create.sql | 16 ++++++++++++++++
utils/kamctl/postgres/mtree-create.sql | 8 ++++++++
3 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/utils/kamctl/mysql/mtree-create.sql b/utils/kamctl/mysql/mtree-create.sql
new file mode 100644
index 0000000..d3ecf46
--- /dev/null
+++ b/utils/kamctl/mysql/mtree-create.sql
@@ -0,0 +1,8 @@
+INSERT INTO version (table_name, table_version) values ('mtree','1');
+CREATE TABLE mtree (
+ id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ tprefix VARCHAR(32) DEFAULT '' NOT NULL,
+ tvalue VARCHAR(128) DEFAULT '' NOT NULL,
+ CONSTRAINT tprefix_idx UNIQUE (tprefix)
+) ENGINE=MyISAM;
+
diff --git a/utils/kamctl/oracle/mtree-create.sql b/utils/kamctl/oracle/mtree-create.sql
new file mode 100644
index 0000000..7b74db4
--- /dev/null
+++ b/utils/kamctl/oracle/mtree-create.sql
@@ -0,0 +1,16 @@
+INSERT INTO version (table_name, table_version) values ('mtree','1');
+CREATE TABLE mtree (
+ id NUMBER(10) PRIMARY KEY,
+ tprefix VARCHAR2(32) DEFAULT '',
+ tvalue VARCHAR2(128) DEFAULT '',
+ CONSTRAINT mtree_tprefix_idx UNIQUE (tprefix)
+);
+
+CREATE OR REPLACE TRIGGER mtree_tr
+before insert on mtree FOR EACH ROW
+BEGIN
+ auto_id(:NEW.id);
+END mtree_tr;
+/
+BEGIN map2users('mtree'); END;
+/
diff --git a/utils/kamctl/postgres/mtree-create.sql b/utils/kamctl/postgres/mtree-create.sql
new file mode 100644
index 0000000..6d60f20
--- /dev/null
+++ b/utils/kamctl/postgres/mtree-create.sql
@@ -0,0 +1,8 @@
+INSERT INTO version (table_name, table_version) values ('mtree','1');
+CREATE TABLE mtree (
+ id SERIAL PRIMARY KEY NOT NULL,
+ tprefix VARCHAR(32) DEFAULT '' NOT NULL,
+ tvalue VARCHAR(128) DEFAULT '' NOT NULL,
+ CONSTRAINT mtree_tprefix_idx UNIQUE (tprefix)
+);
+
More information about the sr-dev
mailing list