2
0
Эх сурвалжийг харах

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.
Peter Dunkley 13 жил өмнө
parent
commit
ffb5799a51

+ 12 - 0
lib/srdb1/schema/pr_active_watchers.xml

@@ -186,6 +186,13 @@
         <description>From Domain</description>
         <description>From Domain</description>
     </column>
     </column>
 
 
+    <column id="updated">
+        <name>updated</name>
+        <type>int</type>
+        <size>&expires_len;</size>
+        <description>Update flag</description>
+    </column>
+
     <index>
     <index>
         <name>active_watchers_idx</name>
         <name>active_watchers_idx</name>
         <colref linkend="callid"/>
         <colref linkend="callid"/>
@@ -205,4 +212,9 @@
         <description>This index is needed only if you use DB_ONLY mode.</description>
         <description>This index is needed only if you use DB_ONLY mode.</description>
     </index>
     </index>
 
 
+    <index>
+        <name>updated_idx</name>
+        <colref linkend="updated"/>
+    </index>
+
 </table>
 </table>

+ 2 - 2
utils/kamctl/db_berkeley/kamailio/active_watchers

@@ -1,5 +1,5 @@
 METADATA_COLUMNS
 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
 METADATA_KEY
 1 6 
 1 6 
 METADATA_READONLY
 METADATA_READONLY
@@ -7,4 +7,4 @@ METADATA_READONLY
 METADATA_LOGFLAGS
 METADATA_LOGFLAGS
 0
 0
 METADATA_DEFAULTS
 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

+ 2 - 0
utils/kamctl/db_sqlite/presence-create.sql

@@ -40,11 +40,13 @@ CREATE TABLE active_watchers (
     local_contact VARCHAR(128) NOT NULL,
     local_contact VARCHAR(128) NOT NULL,
     from_user VARCHAR(64) NOT NULL,
     from_user VARCHAR(64) NOT NULL,
     from_domain 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)
     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_expires ON active_watchers (expires);
 CREATE INDEX active_watchers_active_watchers_pres ON active_watchers (presentity_uri);
 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');
 INSERT INTO version (table_name, table_version) values ('watchers','3');
 CREATE TABLE watchers (
 CREATE TABLE watchers (

+ 1 - 1
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) 

+ 2 - 0
utils/kamctl/mysql/presence-create.sql

@@ -40,11 +40,13 @@ CREATE TABLE active_watchers (
     local_contact VARCHAR(128) NOT NULL,
     local_contact VARCHAR(128) NOT NULL,
     from_user VARCHAR(64) NOT NULL,
     from_user VARCHAR(64) NOT NULL,
     from_domain 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)
     CONSTRAINT active_watchers_idx UNIQUE (callid, to_tag, from_tag)
 ) ENGINE=MyISAM;
 ) ENGINE=MyISAM;
 
 
 CREATE INDEX active_watchers_expires ON active_watchers (expires);
 CREATE INDEX active_watchers_expires ON active_watchers (expires);
 CREATE INDEX active_watchers_pres ON active_watchers (presentity_uri);
 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');
 INSERT INTO version (table_name, table_version) values ('watchers','3');
 CREATE TABLE watchers (
 CREATE TABLE watchers (

+ 2 - 0
utils/kamctl/oracle/presence-create.sql

@@ -48,6 +48,7 @@ CREATE TABLE active_watchers (
     local_contact VARCHAR2(128),
     local_contact VARCHAR2(128),
     from_user VARCHAR2(64),
     from_user VARCHAR2(64),
     from_domain VARCHAR2(64),
     from_domain VARCHAR2(64),
+    updated NUMBER(10),
     CONSTRAINT ORA_active_watchers_idx  UNIQUE (callid, to_tag, from_tag)
     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_expires  ON active_watchers (expires);
 CREATE INDEX ORA_active_watchers_pres  ON active_watchers (presentity_uri);
 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');
 INSERT INTO version (table_name, table_version) values ('watchers','3');
 CREATE TABLE watchers (
 CREATE TABLE watchers (

+ 2 - 0
utils/kamctl/postgres/presence-create.sql

@@ -40,11 +40,13 @@ CREATE TABLE active_watchers (
     local_contact VARCHAR(128) NOT NULL,
     local_contact VARCHAR(128) NOT NULL,
     from_user VARCHAR(64) NOT NULL,
     from_user VARCHAR(64) NOT NULL,
     from_domain 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)
     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_expires ON active_watchers (expires);
 CREATE INDEX active_watchers_active_watchers_pres ON active_watchers (presentity_uri);
 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');
 INSERT INTO version (table_name, table_version) values ('watchers','3');
 CREATE TABLE watchers (
 CREATE TABLE watchers (