Browse Source

kamctl: regenerated db creation scripts for matrix table updates

Daniel-Constantin Mierla 5 years ago
parent
commit
6689c4e321

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

@@ -1,5 +1,5 @@
 METADATA_COLUMNS
 METADATA_COLUMNS
-first(int) second(int) res(int)
+id(int) first(int) second(int) res(int)
 METADATA_KEY
 METADATA_KEY
 
 
 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|NIL

+ 1 - 1
utils/kamctl/db_redis/kamailio/matrix

@@ -1,2 +1,2 @@
-first/int,second/int,res/int,
+id/int,first/int,second/int,res/int,
 1
 1

+ 1 - 0
utils/kamctl/db_sqlite/matrix-create.sql

@@ -1,4 +1,5 @@
 CREATE TABLE matrix (
 CREATE TABLE matrix (
+    id INTEGER PRIMARY KEY NOT NULL,
     first INTEGER NOT NULL,
     first INTEGER NOT NULL,
     second SMALLINT NOT NULL,
     second SMALLINT NOT NULL,
     res INTEGER NOT NULL
     res INTEGER NOT NULL

+ 1 - 1
utils/kamctl/dbtext/kamailio/matrix

@@ -1 +1 @@
-first(int) second(int) res(int) 
+id(int,auto) first(int) second(int) res(int) 

+ 5 - 0
utils/kamctl/mongodb/kamailio/matrix.json

@@ -2,6 +2,11 @@
   "name": "matrix",
   "name": "matrix",
   "version": 1,
   "version": 1,
   "columns": [
   "columns": [
+    "id": {
+      "type": "int",
+      "default": null,
+      "null": false
+    },
     "first": {
     "first": {
       "type": "int",
       "type": "int",
       "default": null,
       "default": null,

+ 1 - 0
utils/kamctl/mysql/matrix-create.sql

@@ -1,4 +1,5 @@
 CREATE TABLE `matrix` (
 CREATE TABLE `matrix` (
+    `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `first` INT(10) NOT NULL,
     `first` INT(10) NOT NULL,
     `second` SMALLINT(10) NOT NULL,
     `second` SMALLINT(10) NOT NULL,
     `res` INT(10) NOT NULL
     `res` INT(10) NOT NULL

+ 1 - 0
utils/kamctl/oracle/matrix-create.sql

@@ -1,4 +1,5 @@
 CREATE TABLE matrix (
 CREATE TABLE matrix (
+    id NUMBER(10) PRIMARY KEY,
     first NUMBER(10),
     first NUMBER(10),
     second NUMBER(5),
     second NUMBER(5),
     res NUMBER(10)
     res NUMBER(10)

+ 1 - 0
utils/kamctl/postgres/matrix-create.sql

@@ -1,4 +1,5 @@
 CREATE TABLE matrix (
 CREATE TABLE matrix (
+    id SERIAL PRIMARY KEY NOT NULL,
     first INTEGER NOT NULL,
     first INTEGER NOT NULL,
     second SMALLINT NOT NULL,
     second SMALLINT NOT NULL,
     res INTEGER NOT NULL
     res INTEGER NOT NULL

+ 20 - 0
utils/kamctl/xhttp_pi/matrix-mod

@@ -4,6 +4,7 @@
 			<db_table_id>matrix</db_table_id>
 			<db_table_id>matrix</db_table_id>
 			<cmd_type>DB1_QUERY</cmd_type>
 			<cmd_type>DB1_QUERY</cmd_type>
 			<query_cols>
 			<query_cols>
+				<col><field>id</field><link_cmd>update</link_cmd></col>
 				<col><field>first</field></col>
 				<col><field>first</field></col>
 				<col><field>second</field></col>
 				<col><field>second</field></col>
 				<col><field>res</field></col>
 				<col><field>res</field></col>
@@ -18,4 +19,23 @@
 				<col><field>res</field></col>
 				<col><field>res</field></col>
 			</query_cols>
 			</query_cols>
 		</cmd>
 		</cmd>
+		<cmd><cmd_name>update</cmd_name>
+			<db_table_id>matrix</db_table_id>
+			<cmd_type>DB1_UPDATE</cmd_type>
+			<clause_cols>
+				<col><field>id</field><operator>=</operator></col>
+			</clause_cols>
+			<query_cols>
+				<col><field>first</field></col>
+				<col><field>second</field></col>
+				<col><field>res</field></col>
+			</query_cols>
+		</cmd>
+		<cmd><cmd_name>delete</cmd_name>
+			<db_table_id>matrix</db_table_id>
+			<cmd_type>DB1_DELETE</cmd_type>
+			<clause_cols>
+				<col><field>id</field><operator>=</operator></col>
+			</clause_cols>
+		</cmd>
 	</mod>
 	</mod>

+ 1 - 0
utils/kamctl/xhttp_pi/matrix-table

@@ -2,6 +2,7 @@
 	<db_table id="matrix">
 	<db_table id="matrix">
 		<table_name>matrix</table_name>
 		<table_name>matrix</table_name>
 		<db_url_id>mysql</db_url_id>
 		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
 		<column><field>first</field><type>DB1_INT</type></column>
 		<column><field>first</field><type>DB1_INT</type></column>
 		<column><field>second</field><type>DB1_INT</type></column>
 		<column><field>second</field><type>DB1_INT</type></column>
 		<column><field>res</field><type>DB1_INT</type></column>
 		<column><field>res</field><type>DB1_INT</type></column>

+ 21 - 0
utils/kamctl/xhttp_pi/pi_framework.xml

@@ -388,6 +388,7 @@
 	<db_table id="matrix">
 	<db_table id="matrix">
 		<table_name>matrix</table_name>
 		<table_name>matrix</table_name>
 		<db_url_id>mysql</db_url_id>
 		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
 		<column><field>first</field><type>DB1_INT</type></column>
 		<column><field>first</field><type>DB1_INT</type></column>
 		<column><field>second</field><type>DB1_INT</type></column>
 		<column><field>second</field><type>DB1_INT</type></column>
 		<column><field>res</field><type>DB1_INT</type></column>
 		<column><field>res</field><type>DB1_INT</type></column>
@@ -2520,6 +2521,7 @@
 			<db_table_id>matrix</db_table_id>
 			<db_table_id>matrix</db_table_id>
 			<cmd_type>DB1_QUERY</cmd_type>
 			<cmd_type>DB1_QUERY</cmd_type>
 			<query_cols>
 			<query_cols>
+				<col><field>id</field><link_cmd>update</link_cmd></col>
 				<col><field>first</field></col>
 				<col><field>first</field></col>
 				<col><field>second</field></col>
 				<col><field>second</field></col>
 				<col><field>res</field></col>
 				<col><field>res</field></col>
@@ -2534,6 +2536,25 @@
 				<col><field>res</field></col>
 				<col><field>res</field></col>
 			</query_cols>
 			</query_cols>
 		</cmd>
 		</cmd>
+		<cmd><cmd_name>update</cmd_name>
+			<db_table_id>matrix</db_table_id>
+			<cmd_type>DB1_UPDATE</cmd_type>
+			<clause_cols>
+				<col><field>id</field><operator>=</operator></col>
+			</clause_cols>
+			<query_cols>
+				<col><field>first</field></col>
+				<col><field>second</field></col>
+				<col><field>res</field></col>
+			</query_cols>
+		</cmd>
+		<cmd><cmd_name>delete</cmd_name>
+			<db_table_id>matrix</db_table_id>
+			<cmd_type>DB1_DELETE</cmd_type>
+			<clause_cols>
+				<col><field>id</field><operator>=</operator></col>
+			</clause_cols>
+		</cmd>
 	</mod>
 	</mod>
 	<!-- mohqcalls provisionning -->
 	<!-- mohqcalls provisionning -->
 	<mod><mod_name>mohqcalls</mod_name>
 	<mod><mod_name>mohqcalls</mod_name>