Module: sip-router
Branch: master
Commit: ffb5799a51f6e2532fc1636d653d89ee3887bbc9
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ffb5799…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Date: Fri Apr 20 16:27:03 2012 +0100
lib/srdb1/schema, utils/kamctl: Updated db schemas for upcoming presence notifier
development
- Added the new column to active_watchers so that the schemas don't
change after the code freeze on Monday.
---
lib/srdb1/schema/pr_active_watchers.xml | 12 ++++++++++++
utils/kamctl/db_berkeley/kamailio/active_watchers | 4 ++--
utils/kamctl/db_sqlite/presence-create.sql | 2 ++
utils/kamctl/dbtext/kamailio/active_watchers | 2 +-
utils/kamctl/mysql/presence-create.sql | 2 ++
utils/kamctl/oracle/presence-create.sql | 2 ++
utils/kamctl/postgres/presence-create.sql | 2 ++
7 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/lib/srdb1/schema/pr_active_watchers.xml
b/lib/srdb1/schema/pr_active_watchers.xml
index 0a5e3b7..7956a65 100644
--- a/lib/srdb1/schema/pr_active_watchers.xml
+++ b/lib/srdb1/schema/pr_active_watchers.xml
@@ -186,6 +186,13 @@
<description>From Domain</description>
</column>
+ <column id="updated">
+ <name>updated</name>
+ <type>int</type>
+ <size>&expires_len;</size>
+ <description>Update flag</description>
+ </column>
+
<index>
<name>active_watchers_idx</name>
<colref linkend="callid"/>
@@ -205,4 +212,9 @@
<description>This index is needed only if you use DB_ONLY
mode.</description>
</index>
+ <index>
+ <name>updated_idx</name>
+ <colref linkend="updated"/>
+ </index>
+
</table>
diff --git a/utils/kamctl/db_berkeley/kamailio/active_watchers
b/utils/kamctl/db_berkeley/kamailio/active_watchers
index 1780a14..bdb152d 100644
--- a/utils/kamctl/db_berkeley/kamailio/active_watchers
+++ b/utils/kamctl/db_berkeley/kamailio/active_watchers
@@ -1,5 +1,5 @@
METADATA_COLUMNS
-id(int) presentity_uri(str) watcher_username(str) watcher_domain(str) to_user(str)
to_domain(str) event(str) event_id(str) to_tag(str) from_tag(str) callid(str)
local_cseq(int) remote_cseq(int) contact(str) record_route(str) expires(int) status(int)
reason(str) version(int) socket_info(str) local_contact(str) from_user(str)
from_domain(str)
+id(int) presentity_uri(str) watcher_username(str) watcher_domain(str) to_user(str)
to_domain(str) event(str) event_id(str) to_tag(str) from_tag(str) callid(str)
local_cseq(int) remote_cseq(int) contact(str) record_route(str) expires(int) status(int)
reason(str) version(int) socket_info(str) local_contact(str) from_user(str)
from_domain(str) updated(int)
METADATA_KEY
1 6
METADATA_READONLY
@@ -7,4 +7,4 @@ METADATA_READONLY
METADATA_LOGFLAGS
0
METADATA_DEFAULTS
-NIL|NIL|NIL|NIL|NIL|NIL|'presence'|NIL|NIL|NIL|NIL|NIL|NIL|NIL|NIL|NIL|2|NIL|0|NIL|NIL|NIL|NIL
+NIL|NIL|NIL|NIL|NIL|NIL|'presence'|NIL|NIL|NIL|NIL|NIL|NIL|NIL|NIL|NIL|2|NIL|0|NIL|NIL|NIL|NIL|NIL
diff --git a/utils/kamctl/db_sqlite/presence-create.sql
b/utils/kamctl/db_sqlite/presence-create.sql
index e3fe435..517153e 100644
--- a/utils/kamctl/db_sqlite/presence-create.sql
+++ b/utils/kamctl/db_sqlite/presence-create.sql
@@ -40,11 +40,13 @@ CREATE TABLE active_watchers (
local_contact VARCHAR(128) NOT NULL,
from_user VARCHAR(64) NOT NULL,
from_domain VARCHAR(64) NOT NULL,
+ updated INTEGER NOT NULL,
CONSTRAINT active_watchers_active_watchers_idx UNIQUE (callid, to_tag, from_tag)
);
CREATE INDEX active_watchers_active_watchers_expires ON active_watchers (expires);
CREATE INDEX active_watchers_active_watchers_pres ON active_watchers (presentity_uri);
+CREATE INDEX active_watchers_updated_idx ON active_watchers (updated);
INSERT INTO version (table_name, table_version) values ('watchers','3');
CREATE TABLE watchers (
diff --git a/utils/kamctl/dbtext/kamailio/active_watchers
b/utils/kamctl/dbtext/kamailio/active_watchers
index 0640d4f..01a89a2 100644
--- a/utils/kamctl/dbtext/kamailio/active_watchers
+++ b/utils/kamctl/dbtext/kamailio/active_watchers
@@ -1 +1 @@
-id(int,auto) presentity_uri(string) watcher_username(string) watcher_domain(string)
to_user(string) to_domain(string) event(string) event_id(string,null) to_tag(string)
from_tag(string) callid(string) local_cseq(int) remote_cseq(int) contact(string)
record_route(string,null) expires(int) status(int) reason(string) version(int)
socket_info(string) local_contact(string) from_user(string) from_domain(string)
+id(int,auto) presentity_uri(string) watcher_username(string) watcher_domain(string)
to_user(string) to_domain(string) event(string) event_id(string,null) to_tag(string)
from_tag(string) callid(string) local_cseq(int) remote_cseq(int) contact(string)
record_route(string,null) expires(int) status(int) reason(string) version(int)
socket_info(string) local_contact(string) from_user(string) from_domain(string)
updated(int)
diff --git a/utils/kamctl/mysql/presence-create.sql
b/utils/kamctl/mysql/presence-create.sql
index eb735a5..05a3267 100644
--- a/utils/kamctl/mysql/presence-create.sql
+++ b/utils/kamctl/mysql/presence-create.sql
@@ -40,11 +40,13 @@ CREATE TABLE active_watchers (
local_contact VARCHAR(128) NOT NULL,
from_user VARCHAR(64) NOT NULL,
from_domain VARCHAR(64) NOT NULL,
+ updated INT(11) NOT NULL,
CONSTRAINT active_watchers_idx UNIQUE (callid, to_tag, from_tag)
) ENGINE=MyISAM;
CREATE INDEX active_watchers_expires ON active_watchers (expires);
CREATE INDEX active_watchers_pres ON active_watchers (presentity_uri);
+CREATE INDEX updated_idx ON active_watchers (updated);
INSERT INTO version (table_name, table_version) values ('watchers','3');
CREATE TABLE watchers (
diff --git a/utils/kamctl/oracle/presence-create.sql
b/utils/kamctl/oracle/presence-create.sql
index 8a8b951..ccabd25 100644
--- a/utils/kamctl/oracle/presence-create.sql
+++ b/utils/kamctl/oracle/presence-create.sql
@@ -48,6 +48,7 @@ CREATE TABLE active_watchers (
local_contact VARCHAR2(128),
from_user VARCHAR2(64),
from_domain VARCHAR2(64),
+ updated NUMBER(10),
CONSTRAINT ORA_active_watchers_idx UNIQUE (callid, to_tag, from_tag)
);
@@ -61,6 +62,7 @@ BEGIN map2users('active_watchers'); END;
/
CREATE INDEX ORA_active_watchers_expires ON active_watchers (expires);
CREATE INDEX ORA_active_watchers_pres ON active_watchers (presentity_uri);
+CREATE INDEX active_watchers_updated_idx ON active_watchers (updated);
INSERT INTO version (table_name, table_version) values ('watchers','3');
CREATE TABLE watchers (
diff --git a/utils/kamctl/postgres/presence-create.sql
b/utils/kamctl/postgres/presence-create.sql
index b41e882..d063dff 100644
--- a/utils/kamctl/postgres/presence-create.sql
+++ b/utils/kamctl/postgres/presence-create.sql
@@ -40,11 +40,13 @@ CREATE TABLE active_watchers (
local_contact VARCHAR(128) NOT NULL,
from_user VARCHAR(64) NOT NULL,
from_domain VARCHAR(64) NOT NULL,
+ updated INTEGER NOT NULL,
CONSTRAINT active_watchers_active_watchers_idx UNIQUE (callid, to_tag, from_tag)
);
CREATE INDEX active_watchers_active_watchers_expires ON active_watchers (expires);
CREATE INDEX active_watchers_active_watchers_pres ON active_watchers (presentity_uri);
+CREATE INDEX active_watchers_updated_idx ON active_watchers (updated);
INSERT INTO version (table_name, table_version) values ('watchers','3');
CREATE TABLE watchers (