kamctl: db creation scripts regenerated
authorDaniel-Constantin Mierla <miconda@gmail.com>
Sat, 14 Mar 2020 17:34:10 +0000 (18:34 +0100)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Sat, 14 Mar 2020 17:34:10 +0000 (18:34 +0100)
utils/kamctl/db_berkeley/kamailio/version
utils/kamctl/db_redis/kamailio/version
utils/kamctl/db_sqlite/standard-create.sql
utils/kamctl/dbtext/kamailio/version
utils/kamctl/mongodb/kamailio/version.json
utils/kamctl/mysql/standard-create.sql
utils/kamctl/oracle/standard-create.sql
utils/kamctl/postgres/standard-create.sql
utils/kamctl/xhttp_pi/pi_framework.xml
utils/kamctl/xhttp_pi/standard-mod
utils/kamctl/xhttp_pi/standard-table

index 22177bf..5a5d5bd 100644 (file)
@@ -1,13 +1,13 @@
 METADATA_COLUMNS
-table_name(str) table_version(int)
+id(int) table_name(str) table_version(int)
 METADATA_KEY
-0 
+1 
 METADATA_READONLY
 0
 METADATA_LOGFLAGS
 0
 METADATA_DEFAULTS
-NIL|0
+NIL|NIL|0
 version|
 version|1
 acc|
@@ -64,8 +64,6 @@ imc_members|
 imc_members|1
 imc_rooms|
 imc_rooms|1
-METADATA_DEFAULTS
-NIL|NIL|''|NIL|NIL|NULL|NULL|NULL|NULL|'2030-05-28 21:32:15'|1.0|'Default-Call-ID'|1|'2000-01-01 00:00:01'|0|0|''|NULL|NULL|NULL
 lcr_gw|
 lcr_gw|3
 lcr_rule|
index b9353c0..0b78f3a 100644 (file)
@@ -1,2 +1,2 @@
-table_name/string,table_version/int,
+id/int,table_name/string,table_version/int,
 1
index 0c8cc02..b11235d 100644 (file)
@@ -1,4 +1,5 @@
 CREATE TABLE version (
+    id INTEGER PRIMARY KEY NOT NULL,
     table_name VARCHAR(32) NOT NULL,
     table_version INTEGER DEFAULT 0 NOT NULL,
     CONSTRAINT version_table_name_idx UNIQUE (table_name)
index 03a4501..c639c5b 100644 (file)
@@ -1,4 +1,4 @@
-table_name(string) table_version(int) 
+id(int,auto) table_name(string) table_version(int) 
 version:1
 acc:5
 acc_cdrs:2
index 2caa283..aeda13a 100644 (file)
@@ -2,6 +2,11 @@
   "name": "version",
   "version": 1,
   "columns": [
+    "id": {
+      "type": "int",
+      "default": null,
+      "null": false
+    },
     "table_name": {
       "type": "string",
       "default": null,
index ae16e0e..f419753 100644 (file)
@@ -1,4 +1,5 @@
 CREATE TABLE `version` (
+    `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `table_name` VARCHAR(32) NOT NULL,
     `table_version` INT UNSIGNED DEFAULT 0 NOT NULL,
     CONSTRAINT table_name_idx UNIQUE (`table_name`)
index a6672e6..e36f420 100644 (file)
@@ -1,4 +1,5 @@
 CREATE TABLE version (
+    id NUMBER(10) PRIMARY KEY,
     table_name VARCHAR2(32),
     table_version NUMBER(10) DEFAULT 0 NOT NULL,
     CONSTRAINT version_table_name_idx  UNIQUE (table_name)
index 0c8cc02..5e62aa2 100644 (file)
@@ -1,4 +1,5 @@
 CREATE TABLE version (
+    id SERIAL PRIMARY KEY NOT NULL,
     table_name VARCHAR(32) NOT NULL,
     table_version INTEGER DEFAULT 0 NOT NULL,
     CONSTRAINT version_table_name_idx UNIQUE (table_name)
index f53e4a1..de448e3 100644 (file)
                <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>
                <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>
        <db_table id="version">
                <table_name>version</table_name>
                <db_url_id>mysql</db_url_id>
+               <column><field>id</field><type>DB1_INT</type></column>
                <column><field>table_name</field><type>DB1_STR</type></column>
                <column><field>table_version</field><type>DB1_INT</type></column>
        </db_table>
                        <db_table_id>version</db_table_id>
                        <cmd_type>DB1_QUERY</cmd_type>
                        <query_cols>
+                               <col><field>id</field><link_cmd>update</link_cmd></col>
                                <col><field>table_name</field></col>
                                <col><field>table_version</field></col>
                        </query_cols>
                                <col><field>table_version</field></col>
                        </query_cols>
                </cmd>
+               <cmd><cmd_name>update</cmd_name>
+                       <db_table_id>version</db_table_id>
+                       <cmd_type>DB1_UPDATE</cmd_type>
+                       <clause_cols>
+                               <col><field>id</field><operator>=</operator></col>
+                       </clause_cols>
+                       <query_cols>
+                               <col><field>table_name</field></col>
+                               <col><field>table_version</field></col>
+                       </query_cols>
+               </cmd>
+               <cmd><cmd_name>delete</cmd_name>
+                       <db_table_id>version</db_table_id>
+                       <cmd_type>DB1_DELETE</cmd_type>
+                       <clause_cols>
+                               <col><field>id</field><operator>=</operator></col>
+                       </clause_cols>
+               </cmd>
        </mod>
        <!-- topos_d provisionning -->
        <mod><mod_name>topos_d</mod_name>
index f3bcbf6..11d90d2 100644 (file)
@@ -4,6 +4,7 @@
                        <db_table_id>version</db_table_id>
                        <cmd_type>DB1_QUERY</cmd_type>
                        <query_cols>
+                               <col><field>id</field><link_cmd>update</link_cmd></col>
                                <col><field>table_name</field></col>
                                <col><field>table_version</field></col>
                        </query_cols>
                                <col><field>table_version</field></col>
                        </query_cols>
                </cmd>
+               <cmd><cmd_name>update</cmd_name>
+                       <db_table_id>version</db_table_id>
+                       <cmd_type>DB1_UPDATE</cmd_type>
+                       <clause_cols>
+                               <col><field>id</field><operator>=</operator></col>
+                       </clause_cols>
+                       <query_cols>
+                               <col><field>table_name</field></col>
+                               <col><field>table_version</field></col>
+                       </query_cols>
+               </cmd>
+               <cmd><cmd_name>delete</cmd_name>
+                       <db_table_id>version</db_table_id>
+                       <cmd_type>DB1_DELETE</cmd_type>
+                       <clause_cols>
+                               <col><field>id</field><operator>=</operator></col>
+                       </clause_cols>
+               </cmd>
        </mod>
index 826ac24..d534534 100644 (file)
@@ -2,6 +2,7 @@
        <db_table id="version">
                <table_name>version</table_name>
                <db_url_id>mysql</db_url_id>
+               <column><field>id</field><type>DB1_INT</type></column>
                <column><field>table_name</field><type>DB1_STR</type></column>
                <column><field>table_version</field><type>DB1_INT</type></column>
        </db_table>