Pārlūkot izejas kodu

kamctl: regenerated database creation scripts

- target on location_attrs table
- affected xhttp_pi and sca
Daniel-Constantin Mierla 13 gadi atpakaļ
vecāks
revīzija
f636e21508

+ 12 - 0
utils/kamctl/db_berkeley/kamailio/location_attrs

@@ -0,0 +1,12 @@
+METADATA_COLUMNS
+id(int) ruid(str) username(str) domain(str) aname(str) atype(int) avalue(str) last_modified(datetime)
+METADATA_KEY
+1 2 3 
+METADATA_READONLY
+0
+METADATA_LOGFLAGS
+0
+METADATA_DEFAULTS
+NIL|''|''|NULL|''|0|''|'1900-01-01 00:00:01'
+location_attrs|
+location_attrs|1

+ 2 - 2
utils/kamctl/db_sqlite/sca-create.sql

@@ -1,4 +1,4 @@
-INSERT INTO version (table_name, table_version) values ('sca_subscriptions','1');
+INSERT INTO version (table_name, table_version) values ('sca_subscriptions','0');
 CREATE TABLE sca_subscriptions (
     id INTEGER PRIMARY KEY NOT NULL,
     subscriber VARCHAR(255) NOT NULL,
@@ -10,7 +10,7 @@ CREATE TABLE sca_subscriptions (
     call_id VARCHAR(255) NOT NULL,
     from_tag VARCHAR(64) NOT NULL,
     to_tag VARCHAR(64) NOT NULL,
-    record_route TEXT DEFAULT NULL,
+    record_route TEXT,
     notify_cseq INTEGER NOT NULL,
     subscribe_cseq INTEGER NOT NULL,
     CONSTRAINT sca_subscriptions_sca_subscriptions_idx UNIQUE (subscriber, call_id, from_tag, to_tag)

+ 15 - 0
utils/kamctl/db_sqlite/usrloc-create.sql

@@ -25,3 +25,18 @@ CREATE TABLE location (
 CREATE INDEX location_account_contact_idx ON location (username, domain, contact);
 CREATE INDEX location_expires_idx ON location (expires);
 
+INSERT INTO version (table_name, table_version) values ('location_attrs','1');
+CREATE TABLE location_attrs (
+    id INTEGER PRIMARY KEY NOT NULL,
+    ruid VARCHAR(64) DEFAULT '' NOT NULL,
+    username VARCHAR(64) DEFAULT '' NOT NULL,
+    domain VARCHAR(64) DEFAULT NULL,
+    aname VARCHAR(64) DEFAULT '' NOT NULL,
+    atype INTEGER DEFAULT 0 NOT NULL,
+    avalue VARCHAR(255) DEFAULT '' NOT NULL,
+    last_modified TIMESTAMP WITHOUT TIME ZONE DEFAULT '1900-01-01 00:00:01' NOT NULL
+);
+
+CREATE INDEX location_attrs_account_record_idx ON location_attrs (username, domain, ruid);
+CREATE INDEX location_attrs_last_modified_idx ON location_attrs (last_modified);
+

+ 2 - 0
utils/kamctl/dbtext/kamailio/location_attrs

@@ -0,0 +1,2 @@
+id(int,auto) ruid(string) username(string) domain(string,null) aname(string) atype(int) avalue(string) last_modified(int) 
+location_attrs:1

+ 2 - 2
utils/kamctl/mysql/sca-create.sql

@@ -1,4 +1,4 @@
-INSERT INTO version (table_name, table_version) values ('sca_subscriptions','1');
+INSERT INTO version (table_name, table_version) values ('sca_subscriptions','0');
 CREATE TABLE sca_subscriptions (
     id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     subscriber VARCHAR(255) NOT NULL,
@@ -10,7 +10,7 @@ CREATE TABLE sca_subscriptions (
     call_id VARCHAR(255) NOT NULL,
     from_tag VARCHAR(64) NOT NULL,
     to_tag VARCHAR(64) NOT NULL,
-    record_route TEXT DEFAULT NULL,
+    record_route TEXT,
     notify_cseq INT(11) NOT NULL,
     subscribe_cseq INT(11) NOT NULL,
     CONSTRAINT sca_subscriptions_idx UNIQUE (subscriber, call_id, from_tag, to_tag)

+ 15 - 0
utils/kamctl/mysql/usrloc-create.sql

@@ -25,3 +25,18 @@ CREATE TABLE location (
 CREATE INDEX account_contact_idx ON location (username, domain, contact);
 CREATE INDEX expires_idx ON location (expires);
 
+INSERT INTO version (table_name, table_version) values ('location_attrs','1');
+CREATE TABLE location_attrs (
+    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+    ruid VARCHAR(64) DEFAULT '' NOT NULL,
+    username VARCHAR(64) DEFAULT '' NOT NULL,
+    domain VARCHAR(64) DEFAULT NULL,
+    aname VARCHAR(64) DEFAULT '' NOT NULL,
+    atype INT(11) DEFAULT 0 NOT NULL,
+    avalue VARCHAR(255) DEFAULT '' NOT NULL,
+    last_modified DATETIME DEFAULT '1900-01-01 00:00:01' NOT NULL
+) ENGINE=MyISAM;
+
+CREATE INDEX account_record_idx ON location_attrs (username, domain, ruid);
+CREATE INDEX last_modified_idx ON location_attrs (last_modified);
+

+ 1 - 1
utils/kamctl/oracle/sca-create.sql

@@ -1,4 +1,4 @@
-INSERT INTO version (table_name, table_version) values ('sca_subscriptions','1');
+INSERT INTO version (table_name, table_version) values ('sca_subscriptions','0');
 CREATE TABLE sca_subscriptions (
     id NUMBER(10) PRIMARY KEY,
     subscriber VARCHAR2(255),

+ 23 - 0
utils/kamctl/oracle/usrloc-create.sql

@@ -33,3 +33,26 @@ BEGIN map2users('location'); END;
 CREATE INDEX location_account_contact_idx  ON location (username, domain, contact);
 CREATE INDEX location_expires_idx  ON location (expires);
 
+INSERT INTO version (table_name, table_version) values ('location_attrs','1');
+CREATE TABLE location_attrs (
+    id NUMBER(10) PRIMARY KEY,
+    ruid VARCHAR2(64) DEFAULT '',
+    username VARCHAR2(64) DEFAULT '',
+    domain VARCHAR2(64) DEFAULT NULL,
+    aname VARCHAR2(64) DEFAULT '',
+    atype NUMBER(10) DEFAULT 0 NOT NULL,
+    avalue VARCHAR2(255) DEFAULT '',
+    last_modified DATE DEFAULT to_date('1900-01-01 00:00:01','yyyy-mm-dd hh24:mi:ss')
+);
+
+CREATE OR REPLACE TRIGGER location_attrs_tr
+before insert on location_attrs FOR EACH ROW
+BEGIN
+  auto_id(:NEW.id);
+END location_attrs_tr;
+/
+BEGIN map2users('location_attrs'); END;
+/
+CREATE INDEX ORA_account_record_idx  ON location_attrs (username, domain, ruid);
+CREATE INDEX ORA_last_modified_idx  ON location_attrs (last_modified);
+

+ 2 - 2
utils/kamctl/postgres/sca-create.sql

@@ -1,4 +1,4 @@
-INSERT INTO version (table_name, table_version) values ('sca_subscriptions','1');
+INSERT INTO version (table_name, table_version) values ('sca_subscriptions','0');
 CREATE TABLE sca_subscriptions (
     id SERIAL PRIMARY KEY NOT NULL,
     subscriber VARCHAR(255) NOT NULL,
@@ -10,7 +10,7 @@ CREATE TABLE sca_subscriptions (
     call_id VARCHAR(255) NOT NULL,
     from_tag VARCHAR(64) NOT NULL,
     to_tag VARCHAR(64) NOT NULL,
-    record_route TEXT DEFAULT NULL,
+    record_route TEXT,
     notify_cseq INTEGER NOT NULL,
     subscribe_cseq INTEGER NOT NULL,
     CONSTRAINT sca_subscriptions_sca_subscriptions_idx UNIQUE (subscriber, call_id, from_tag, to_tag)

+ 15 - 0
utils/kamctl/postgres/usrloc-create.sql

@@ -25,3 +25,18 @@ CREATE TABLE location (
 CREATE INDEX location_account_contact_idx ON location (username, domain, contact);
 CREATE INDEX location_expires_idx ON location (expires);
 
+INSERT INTO version (table_name, table_version) values ('location_attrs','1');
+CREATE TABLE location_attrs (
+    id SERIAL PRIMARY KEY NOT NULL,
+    ruid VARCHAR(64) DEFAULT '' NOT NULL,
+    username VARCHAR(64) DEFAULT '' NOT NULL,
+    domain VARCHAR(64) DEFAULT NULL,
+    aname VARCHAR(64) DEFAULT '' NOT NULL,
+    atype INTEGER DEFAULT 0 NOT NULL,
+    avalue VARCHAR(255) DEFAULT '' NOT NULL,
+    last_modified TIMESTAMP WITHOUT TIME ZONE DEFAULT '1900-01-01 00:00:01' NOT NULL
+);
+
+CREATE INDEX location_attrs_account_record_idx ON location_attrs (username, domain, ruid);
+CREATE INDEX location_attrs_last_modified_idx ON location_attrs (last_modified);
+

+ 41 - 11
utils/kamctl/xhttp_pi/pi_framework.xml

@@ -212,17 +212,6 @@
 		<column><field>attrs</field><type>DB1_STR</type></column>
 		<column><field>description</field><type>DB1_STR</type></column>
 	</db_table>
-	<!-- Declaration of domainpolicy table-->
-	<db_table id="domainpolicy">
-		<table_name>domainpolicy</table_name>
-		<db_url_id>mysql</db_url_id>
-		<column><field>id</field><type>DB1_INT</type></column>
-		<column><field>rule</field><type>DB1_STR</type></column>
-		<column><field>type</field><type>DB1_STR</type></column>
-		<column><field>att</field><type>DB1_STR</type></column>
-		<column><field>val</field><type>DB1_STR</type></column>
-		<column><field>description</field><type>DB1_STR</type></column>
-	</db_table>
 	<!-- Declaration of domain table-->
 	<db_table id="domain">
 		<table_name>domain</table_name>
@@ -243,6 +232,17 @@
 		<column><field>value</field><type>DB1_STR</type></column>
 		<column><field>last_modified</field><type>DB1_DATETIME</type></column>
 	</db_table>
+	<!-- Declaration of domainpolicy table-->
+	<db_table id="domainpolicy">
+		<table_name>domainpolicy</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>rule</field><type>DB1_STR</type></column>
+		<column><field>type</field><type>DB1_STR</type></column>
+		<column><field>att</field><type>DB1_STR</type></column>
+		<column><field>val</field><type>DB1_STR</type></column>
+		<column><field>description</field><type>DB1_STR</type></column>
+	</db_table>
 	<!-- Declaration of dr_gateways table-->
 	<db_table id="dr_gateways">
 		<table_name>dr_gateways</table_name>
@@ -755,6 +755,19 @@
 		<column><field>instance</field><type>DB1_STR</type></column>
 		<column><field>reg_id</field><type>DB1_INT</type></column>
 	</db_table>
+	<!-- Declaration of location_attrs table-->
+	<db_table id="location_attrs">
+		<table_name>location_attrs</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>ruid</field><type>DB1_STR</type></column>
+		<column><field>username</field><type>DB1_STR</type></column>
+		<column><field>domain</field><type>DB1_STR</type></column>
+		<column><field>aname</field><type>DB1_STR</type></column>
+		<column><field>atype</field><type>DB1_INT</type></column>
+		<column><field>avalue</field><type>DB1_STR</type></column>
+		<column><field>last_modified</field><type>DB1_DATETIME</type></column>
+	</db_table>
 	<!-- Declare all mods
 		Each mod must have:
 		- a 'mod_name'
@@ -1739,4 +1752,21 @@
 			</query_cols>
 		</cmd>
 	</mod>
+	<!-- location_attrs provisionning -->
+	<mod><mod_name>location_attrs</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>location_attrs</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>ruid</field></col>
+				<col><field>username</field></col>
+				<col><field>domain</field></col>
+				<col><field>aname</field></col>
+				<col><field>atype</field></col>
+				<col><field>avalue</field></col>
+				<col><field>last_modified</field></col>
+			</query_cols>
+		</cmd>
+	</mod>
 </framework>

+ 17 - 0
utils/kamctl/xhttp_pi/usrloc-mod

@@ -26,3 +26,20 @@
 			</query_cols>
 		</cmd>
 	</mod>
+	<!-- location_attrs provisionning -->
+	<mod><mod_name>location_attrs</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>location_attrs</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>ruid</field></col>
+				<col><field>username</field></col>
+				<col><field>domain</field></col>
+				<col><field>aname</field></col>
+				<col><field>atype</field></col>
+				<col><field>avalue</field></col>
+				<col><field>last_modified</field></col>
+			</query_cols>
+		</cmd>
+	</mod>

+ 13 - 0
utils/kamctl/xhttp_pi/usrloc-table

@@ -22,3 +22,16 @@
 		<column><field>instance</field><type>DB1_STR</type></column>
 		<column><field>reg_id</field><type>DB1_INT</type></column>
 	</db_table>
+	<!-- Declaration of location_attrs table-->
+	<db_table id="location_attrs">
+		<table_name>location_attrs</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>ruid</field><type>DB1_STR</type></column>
+		<column><field>username</field><type>DB1_STR</type></column>
+		<column><field>domain</field><type>DB1_STR</type></column>
+		<column><field>aname</field><type>DB1_STR</type></column>
+		<column><field>atype</field><type>DB1_INT</type></column>
+		<column><field>avalue</field><type>DB1_STR</type></column>
+		<column><field>last_modified</field><type>DB1_DATETIME</type></column>
+	</db_table>