Browse Source

kamctl: regenerated db/sql creation scripts for acc_cdrs updates

Daniel-Constantin Mierla 10 years ago
parent
commit
045e2f56e2

+ 1 - 1
utils/kamctl/db_berkeley/kamailio/acc_cdrs

@@ -1,5 +1,5 @@
 METADATA_COLUMNS
-id(int) start_time(str) end_time(str) duration(str)
+id(int) start_time(datetime) end_time(datetime) duration(double)
 METADATA_KEY
 
 METADATA_READONLY

+ 1 - 1
utils/kamctl/db_berkeley/kamailio/version

@@ -11,7 +11,7 @@ NIL|0
 acc|
 acc|5
 acc_cdrs|
-acc_cdrs|1
+acc_cdrs|2
 active_watchers|
 active_watchers|11
 address|

+ 4 - 4
utils/kamctl/db_sqlite/acc-create.sql

@@ -12,12 +12,12 @@ CREATE TABLE acc (
 
 CREATE INDEX acc_callid_idx ON acc (callid);
 
-INSERT INTO version (table_name, table_version) values ('acc_cdrs','1');
+INSERT INTO version (table_name, table_version) values ('acc_cdrs','2');
 CREATE TABLE acc_cdrs (
     id INTEGER PRIMARY KEY NOT NULL,
-    start_time VARCHAR(32) DEFAULT '' NOT NULL,
-    end_time VARCHAR(32) DEFAULT '' NOT NULL,
-    duration VARCHAR(32) DEFAULT '' NOT NULL
+    start_time TIMESTAMP WITHOUT TIME ZONE DEFAULT '' NOT NULL,
+    end_time TIMESTAMP WITHOUT TIME ZONE DEFAULT '' NOT NULL,
+    duration REAL DEFAULT '' NOT NULL
 );
 
 CREATE INDEX acc_cdrs_start_time_idx ON acc_cdrs (start_time);

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

@@ -1 +1 @@
-id(int,auto) start_time(string) end_time(string) duration(string) 
+id(int,auto) start_time(int) end_time(int) duration(double) 

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

@@ -1,6 +1,6 @@
 table_name(string) table_version(int) 
 acc:5
-acc_cdrs:1
+acc_cdrs:2
 active_watchers:11
 address:6
 aliases:6

+ 4 - 4
utils/kamctl/mysql/acc-create.sql

@@ -12,12 +12,12 @@ CREATE TABLE acc (
 
 CREATE INDEX callid_idx ON acc (callid);
 
-INSERT INTO version (table_name, table_version) values ('acc_cdrs','1');
+INSERT INTO version (table_name, table_version) values ('acc_cdrs','2');
 CREATE TABLE acc_cdrs (
     id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
-    start_time VARCHAR(32) DEFAULT '' NOT NULL,
-    end_time VARCHAR(32) DEFAULT '' NOT NULL,
-    duration VARCHAR(32) DEFAULT '' NOT NULL
+    start_time DATETIME DEFAULT '' NOT NULL,
+    end_time DATETIME DEFAULT '' NOT NULL,
+    duration FLOAT(10,3) DEFAULT '' NOT NULL
 );
 
 CREATE INDEX start_time_idx ON acc_cdrs (start_time);

+ 4 - 4
utils/kamctl/oracle/acc-create.sql

@@ -20,12 +20,12 @@ BEGIN map2users('acc'); END;
 /
 CREATE INDEX acc_callid_idx  ON acc (callid);
 
-INSERT INTO version (table_name, table_version) values ('acc_cdrs','1');
+INSERT INTO version (table_name, table_version) values ('acc_cdrs','2');
 CREATE TABLE acc_cdrs (
     id NUMBER(10) PRIMARY KEY,
-    start_time VARCHAR2(32) DEFAULT '',
-    end_time VARCHAR2(32) DEFAULT '',
-    duration VARCHAR2(32) DEFAULT ''
+    start_time DATE DEFAULT '',
+    end_time DATE DEFAULT '',
+    duration NUMBER(10,3) DEFAULT ''
 );
 
 CREATE OR REPLACE TRIGGER acc_cdrs_tr

+ 4 - 4
utils/kamctl/postgres/acc-create.sql

@@ -12,12 +12,12 @@ CREATE TABLE acc (
 
 CREATE INDEX acc_callid_idx ON acc (callid);
 
-INSERT INTO version (table_name, table_version) values ('acc_cdrs','1');
+INSERT INTO version (table_name, table_version) values ('acc_cdrs','2');
 CREATE TABLE acc_cdrs (
     id SERIAL PRIMARY KEY NOT NULL,
-    start_time VARCHAR(32) DEFAULT '' NOT NULL,
-    end_time VARCHAR(32) DEFAULT '' NOT NULL,
-    duration VARCHAR(32) DEFAULT '' NOT NULL
+    start_time TIMESTAMP WITHOUT TIME ZONE DEFAULT '' NOT NULL,
+    end_time TIMESTAMP WITHOUT TIME ZONE DEFAULT '' NOT NULL,
+    duration REAL DEFAULT '' NOT NULL
 );
 
 CREATE INDEX acc_cdrs_start_time_idx ON acc_cdrs (start_time);

+ 3 - 3
utils/kamctl/xhttp_pi/acc-table

@@ -16,9 +16,9 @@
 		<table_name>acc_cdrs</table_name>
 		<db_url_id>mysql</db_url_id>
 		<column><field>id</field><type>DB1_INT</type></column>
-		<column><field>start_time</field><type>DB1_STR</type></column>
-		<column><field>end_time</field><type>DB1_STR</type></column>
-		<column><field>duration</field><type>DB1_STR</type></column>
+		<column><field>start_time</field><type>DB1_DATETIME</type></column>
+		<column><field>end_time</field><type>DB1_DATETIME</type></column>
+		<column><field>duration</field><type>DB1_DOUBLE</type></column>
 	</db_table>
 	<!-- Declaration of missed_calls table-->
 	<db_table id="missed_calls">

+ 3 - 3
utils/kamctl/xhttp_pi/pi_framework.xml

@@ -47,9 +47,9 @@
 		<table_name>acc_cdrs</table_name>
 		<db_url_id>mysql</db_url_id>
 		<column><field>id</field><type>DB1_INT</type></column>
-		<column><field>start_time</field><type>DB1_STR</type></column>
-		<column><field>end_time</field><type>DB1_STR</type></column>
-		<column><field>duration</field><type>DB1_STR</type></column>
+		<column><field>start_time</field><type>DB1_DATETIME</type></column>
+		<column><field>end_time</field><type>DB1_DATETIME</type></column>
+		<column><field>duration</field><type>DB1_DOUBLE</type></column>
 	</db_table>
 	<!-- Declaration of missed_calls table-->
 	<db_table id="missed_calls">