[sr-dev] git:master: kamctl: regenerated the db creation scripts

Daniel-Constantin Mierla miconda at gmail.com
Tue Sep 11 09:04:52 CEST 2012


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Tue Sep 11 09:02:51 2012 +0200

kamctl: regenerated the db creation scripts

- there were changes in presence tables not propagated to scripts
- it includes the updates for location tables

---

 utils/kamctl/db_sqlite/presence-create.sql  |    4 ++--
 utils/kamctl/db_sqlite/registrar-create.sql |    3 ++-
 utils/kamctl/db_sqlite/usrloc-create.sql    |    5 +++--
 utils/kamctl/mysql/presence-create.sql      |    5 +++--
 utils/kamctl/mysql/registrar-create.sql     |    3 ++-
 utils/kamctl/mysql/usrloc-create.sql        |    5 +++--
 utils/kamctl/oracle/presence-create.sql     |    4 ++--
 utils/kamctl/oracle/registrar-create.sql    |    3 ++-
 utils/kamctl/oracle/usrloc-create.sql       |    5 +++--
 utils/kamctl/postgres/presence-create.sql   |    4 ++--
 utils/kamctl/postgres/registrar-create.sql  |    3 ++-
 utils/kamctl/postgres/usrloc-create.sql     |    5 +++--
 12 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/utils/kamctl/db_sqlite/presence-create.sql b/utils/kamctl/db_sqlite/presence-create.sql
index a9a9157..4e25d80 100644
--- a/utils/kamctl/db_sqlite/presence-create.sql
+++ b/utils/kamctl/db_sqlite/presence-create.sql
@@ -102,10 +102,10 @@ CREATE TABLE pua (
     remote_contact VARCHAR(128) NOT NULL,
     version INTEGER NOT NULL,
     extra_headers TEXT NOT NULL,
-    CONSTRAINT pua_pua_idx UNIQUE (etag, tuple_id, call_id, from_tag),
-    CONSTRAINT pua_expires_idx UNIQUE (expires)
+    CONSTRAINT pua_pua_idx UNIQUE (etag, tuple_id, call_id, from_tag)
 );
 
+CREATE INDEX pua_expires_idx ON pua (expires);
 CREATE INDEX pua_dialog1_idx ON pua (call_id, from_tag, to_tag);
 CREATE INDEX pua_dialog2_idx ON pua (pres_id, pres_uri);
 CREATE INDEX pua_tmp_dlg1_idx ON pua (call_id, from_tag);
diff --git a/utils/kamctl/db_sqlite/registrar-create.sql b/utils/kamctl/db_sqlite/registrar-create.sql
index bcad0f6..f9a4cc4 100644
--- a/utils/kamctl/db_sqlite/registrar-create.sql
+++ b/utils/kamctl/db_sqlite/registrar-create.sql
@@ -18,7 +18,8 @@ CREATE TABLE aliases (
     socket VARCHAR(64) DEFAULT NULL,
     methods INTEGER DEFAULT NULL,
     instance VARCHAR(255) DEFAULT NULL,
-    reg_id INTEGER DEFAULT 0 NOT NULL
+    reg_id INTEGER DEFAULT 0 NOT NULL,
+    CONSTRAINT aliases_ruid_idx UNIQUE (ruid)
 );
 
 CREATE INDEX aliases_alias_idx ON aliases (username, domain, contact);
diff --git a/utils/kamctl/db_sqlite/usrloc-create.sql b/utils/kamctl/db_sqlite/usrloc-create.sql
index 11442f6..6286179 100644
--- a/utils/kamctl/db_sqlite/usrloc-create.sql
+++ b/utils/kamctl/db_sqlite/usrloc-create.sql
@@ -6,7 +6,7 @@ CREATE TABLE location (
     domain VARCHAR(64) DEFAULT NULL,
     contact VARCHAR(255) DEFAULT '' NOT NULL,
     received VARCHAR(128) DEFAULT NULL,
-    path VARCHAR(128) DEFAULT NULL,
+    path VARCHAR(512) DEFAULT NULL,
     expires TIMESTAMP WITHOUT TIME ZONE DEFAULT '2030-05-28 21:32:15' NOT NULL,
     q REAL DEFAULT 1.0 NOT NULL,
     callid VARCHAR(255) DEFAULT 'Default-Call-ID' NOT NULL,
@@ -18,7 +18,8 @@ CREATE TABLE location (
     socket VARCHAR(64) DEFAULT NULL,
     methods INTEGER DEFAULT NULL,
     instance VARCHAR(255) DEFAULT NULL,
-    reg_id INTEGER DEFAULT 0 NOT NULL
+    reg_id INTEGER DEFAULT 0 NOT NULL,
+    CONSTRAINT location_ruid_idx UNIQUE (ruid)
 );
 
 CREATE INDEX location_account_contact_idx ON location (username, domain, contact);
diff --git a/utils/kamctl/mysql/presence-create.sql b/utils/kamctl/mysql/presence-create.sql
index 7f68249..928521e 100644
--- a/utils/kamctl/mysql/presence-create.sql
+++ b/utils/kamctl/mysql/presence-create.sql
@@ -102,13 +102,14 @@ CREATE TABLE pua (
     remote_contact VARCHAR(128) NOT NULL,
     version INT(11) NOT NULL,
     extra_headers TEXT NOT NULL,
-    CONSTRAINT pua_idx UNIQUE (etag, tuple_id, call_id, from_tag),
+    CONSTRAINT pua_idx UNIQUE (etag, tuple_id, call_id, from_tag)
 ) ENGINE=MyISAM;
 
+CREATE INDEX expires_idx ON pua (expires);
 CREATE INDEX dialog1_idx ON pua (call_id, from_tag, to_tag);
 CREATE INDEX dialog2_idx ON pua (pres_id, pres_uri);
 CREATE INDEX tmp_dlg1_idx ON pua (call_id, from_tag);
 CREATE INDEX tmp_dlg2_idx ON pua (pres_id, pres_uri, call_id, from_tag);
 CREATE INDEX tmp_record1_idx ON pua (pres_id);
 CREATE INDEX tmp_record2_idx ON pua (pres_id, etag);
-CREATE INDEX expires_idx ON pua (expires);
+
diff --git a/utils/kamctl/mysql/registrar-create.sql b/utils/kamctl/mysql/registrar-create.sql
index 640f7e8..4d7d9e8 100644
--- a/utils/kamctl/mysql/registrar-create.sql
+++ b/utils/kamctl/mysql/registrar-create.sql
@@ -18,7 +18,8 @@ CREATE TABLE aliases (
     socket VARCHAR(64) DEFAULT NULL,
     methods INT(11) DEFAULT NULL,
     instance VARCHAR(255) DEFAULT NULL,
-    reg_id INT(11) DEFAULT 0 NOT NULL
+    reg_id INT(11) DEFAULT 0 NOT NULL,
+    CONSTRAINT ruid_idx UNIQUE (ruid)
 ) ENGINE=MyISAM;
 
 CREATE INDEX alias_idx ON aliases (username, domain, contact);
diff --git a/utils/kamctl/mysql/usrloc-create.sql b/utils/kamctl/mysql/usrloc-create.sql
index fe26cca..8f4f425 100644
--- a/utils/kamctl/mysql/usrloc-create.sql
+++ b/utils/kamctl/mysql/usrloc-create.sql
@@ -6,7 +6,7 @@ CREATE TABLE location (
     domain VARCHAR(64) DEFAULT NULL,
     contact VARCHAR(255) DEFAULT '' NOT NULL,
     received VARCHAR(128) DEFAULT NULL,
-    path VARCHAR(128) DEFAULT NULL,
+    path VARCHAR(512) DEFAULT NULL,
     expires DATETIME DEFAULT '2030-05-28 21:32:15' NOT NULL,
     q FLOAT(10,2) DEFAULT 1.0 NOT NULL,
     callid VARCHAR(255) DEFAULT 'Default-Call-ID' NOT NULL,
@@ -18,7 +18,8 @@ CREATE TABLE location (
     socket VARCHAR(64) DEFAULT NULL,
     methods INT(11) DEFAULT NULL,
     instance VARCHAR(255) DEFAULT NULL,
-    reg_id INT(11) DEFAULT 0 NOT NULL
+    reg_id INT(11) DEFAULT 0 NOT NULL,
+    CONSTRAINT ruid_idx UNIQUE (ruid)
 ) ENGINE=MyISAM;
 
 CREATE INDEX account_contact_idx ON location (username, domain, contact);
diff --git a/utils/kamctl/oracle/presence-create.sql b/utils/kamctl/oracle/presence-create.sql
index bffdba2..a1c5528 100644
--- a/utils/kamctl/oracle/presence-create.sql
+++ b/utils/kamctl/oracle/presence-create.sql
@@ -134,8 +134,7 @@ CREATE TABLE pua (
     remote_contact VARCHAR2(128),
     version NUMBER(10),
     extra_headers CLOB,
-    CONSTRAINT pua_pua_idx  UNIQUE (etag, tuple_id, call_id, from_tag),
-    CONSTRAINT pua_expires_idx  UNIQUE (expires)
+    CONSTRAINT pua_pua_idx  UNIQUE (etag, tuple_id, call_id, from_tag)
 );
 
 CREATE OR REPLACE TRIGGER pua_tr
@@ -146,6 +145,7 @@ END pua_tr;
 /
 BEGIN map2users('pua'); END;
 /
+CREATE INDEX pua_expires_idx  ON pua (expires);
 CREATE INDEX pua_dialog1_idx  ON pua (call_id, from_tag, to_tag);
 CREATE INDEX pua_dialog2_idx  ON pua (pres_id, pres_uri);
 CREATE INDEX pua_tmp_dlg1_idx  ON pua (call_id, from_tag);
diff --git a/utils/kamctl/oracle/registrar-create.sql b/utils/kamctl/oracle/registrar-create.sql
index d311b41..4c0d5ba 100644
--- a/utils/kamctl/oracle/registrar-create.sql
+++ b/utils/kamctl/oracle/registrar-create.sql
@@ -18,7 +18,8 @@ CREATE TABLE aliases (
     socket VARCHAR2(64) DEFAULT NULL,
     methods NUMBER(10) DEFAULT NULL,
     instance VARCHAR2(255) DEFAULT NULL,
-    reg_id NUMBER(10) DEFAULT 0 NOT NULL
+    reg_id NUMBER(10) DEFAULT 0 NOT NULL,
+    CONSTRAINT aliases_ruid_idx  UNIQUE (ruid)
 );
 
 CREATE OR REPLACE TRIGGER aliases_tr
diff --git a/utils/kamctl/oracle/usrloc-create.sql b/utils/kamctl/oracle/usrloc-create.sql
index 67070c9..8cc677e 100644
--- a/utils/kamctl/oracle/usrloc-create.sql
+++ b/utils/kamctl/oracle/usrloc-create.sql
@@ -6,7 +6,7 @@ CREATE TABLE location (
     domain VARCHAR2(64) DEFAULT NULL,
     contact VARCHAR2(255) DEFAULT '',
     received VARCHAR2(128) DEFAULT NULL,
-    path VARCHAR2(128) DEFAULT NULL,
+    path VARCHAR2(512) DEFAULT NULL,
     expires DATE DEFAULT to_date('2030-05-28 21:32:15','yyyy-mm-dd hh24:mi:ss'),
     q NUMBER(10,2) DEFAULT 1.0 NOT NULL,
     callid VARCHAR2(255) DEFAULT 'Default-Call-ID',
@@ -18,7 +18,8 @@ CREATE TABLE location (
     socket VARCHAR2(64) DEFAULT NULL,
     methods NUMBER(10) DEFAULT NULL,
     instance VARCHAR2(255) DEFAULT NULL,
-    reg_id NUMBER(10) DEFAULT 0 NOT NULL
+    reg_id NUMBER(10) DEFAULT 0 NOT NULL,
+    CONSTRAINT location_ruid_idx  UNIQUE (ruid)
 );
 
 CREATE OR REPLACE TRIGGER location_tr
diff --git a/utils/kamctl/postgres/presence-create.sql b/utils/kamctl/postgres/presence-create.sql
index 1aacd99..cf3fe17 100644
--- a/utils/kamctl/postgres/presence-create.sql
+++ b/utils/kamctl/postgres/presence-create.sql
@@ -102,10 +102,10 @@ CREATE TABLE pua (
     remote_contact VARCHAR(128) NOT NULL,
     version INTEGER NOT NULL,
     extra_headers TEXT NOT NULL,
-    CONSTRAINT pua_pua_idx UNIQUE (etag, tuple_id, call_id, from_tag),
-    CONSTRAINT pua_expires_idx UNIQUE (expires)
+    CONSTRAINT pua_pua_idx UNIQUE (etag, tuple_id, call_id, from_tag)
 );
 
+CREATE INDEX pua_expires_idx ON pua (expires);
 CREATE INDEX pua_dialog1_idx ON pua (call_id, from_tag, to_tag);
 CREATE INDEX pua_dialog2_idx ON pua (pres_id, pres_uri);
 CREATE INDEX pua_tmp_dlg1_idx ON pua (call_id, from_tag);
diff --git a/utils/kamctl/postgres/registrar-create.sql b/utils/kamctl/postgres/registrar-create.sql
index 1f1c382..86d0b11 100644
--- a/utils/kamctl/postgres/registrar-create.sql
+++ b/utils/kamctl/postgres/registrar-create.sql
@@ -18,7 +18,8 @@ CREATE TABLE aliases (
     socket VARCHAR(64) DEFAULT NULL,
     methods INTEGER DEFAULT NULL,
     instance VARCHAR(255) DEFAULT NULL,
-    reg_id INTEGER DEFAULT 0 NOT NULL
+    reg_id INTEGER DEFAULT 0 NOT NULL,
+    CONSTRAINT aliases_ruid_idx UNIQUE (ruid)
 );
 
 CREATE INDEX aliases_alias_idx ON aliases (username, domain, contact);
diff --git a/utils/kamctl/postgres/usrloc-create.sql b/utils/kamctl/postgres/usrloc-create.sql
index 6125845..c161178 100644
--- a/utils/kamctl/postgres/usrloc-create.sql
+++ b/utils/kamctl/postgres/usrloc-create.sql
@@ -6,7 +6,7 @@ CREATE TABLE location (
     domain VARCHAR(64) DEFAULT NULL,
     contact VARCHAR(255) DEFAULT '' NOT NULL,
     received VARCHAR(128) DEFAULT NULL,
-    path VARCHAR(128) DEFAULT NULL,
+    path VARCHAR(512) DEFAULT NULL,
     expires TIMESTAMP WITHOUT TIME ZONE DEFAULT '2030-05-28 21:32:15' NOT NULL,
     q REAL DEFAULT 1.0 NOT NULL,
     callid VARCHAR(255) DEFAULT 'Default-Call-ID' NOT NULL,
@@ -18,7 +18,8 @@ CREATE TABLE location (
     socket VARCHAR(64) DEFAULT NULL,
     methods INTEGER DEFAULT NULL,
     instance VARCHAR(255) DEFAULT NULL,
-    reg_id INTEGER DEFAULT 0 NOT NULL
+    reg_id INTEGER DEFAULT 0 NOT NULL,
+    CONSTRAINT location_ruid_idx UNIQUE (ruid)
 );
 
 CREATE INDEX location_account_contact_idx ON location (username, domain, contact);




More information about the sr-dev mailing list