Ver Fonte

Merge pull request #134 from linuxmaniac/vseva/mysql_errors

kamctl: fixing mysql creation errors
Victor Seva há 10 anos atrás
pai
commit
40730e28f1

+ 3 - 3
lib/srdb1/schema/acc_cdrs.xml

@@ -30,14 +30,14 @@
         <name>start_time</name>
         <type>datetime</type>
         <description>Start date and time</description>
-        <default/>
+        <default>2000-01-01 00:00:00</default>
     </column>
 
     <column>
         <name>end_time</name>
         <type>datetime</type>
         <description>End date and time</description>
-        <default/>
+        <default>2000-01-01 00:00:00</default>
     </column>
 
     <column>
@@ -45,7 +45,7 @@
         <type>float</type>
         <size>10,3</size>
         <description>Duration</description>
-        <default/>
+        <default>0</default>
     </column>
 
     <index>

+ 2 - 2
lib/srdb1/schema/silo.xml

@@ -92,14 +92,14 @@
     <column>
         <name>body</name>
         <type>binary</type>
-        <default/>
+        <null/>
         <description>Body of the message</description>
     </column>
 
     <column>
         <name>extra_hdrs</name>
         <type>text</type>
-        <default/>
+        <null/>
         <description>Extra headers that must be restored</description>
     </column>
 

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

@@ -7,4 +7,4 @@ METADATA_READONLY
 METADATA_LOGFLAGS
 0
 METADATA_DEFAULTS
-NIL|''|''|''
+NIL|'2000-01-01 00:00:00'|'2000-01-01 00:00:00'|0

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

@@ -7,4 +7,4 @@ METADATA_READONLY
 METADATA_LOGFLAGS
 0
 METADATA_DEFAULTS
-NIL|''|''|''|''|0|0|0|'text/plain'|''|''|''|0
+NIL|''|''|''|''|0|0|0|'text/plain'|NIL|NIL|''|0

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

@@ -15,9 +15,9 @@ CREATE INDEX acc_callid_idx ON acc (callid);
 INSERT INTO version (table_name, table_version) values ('acc_cdrs','2');
 CREATE TABLE acc_cdrs (
     id INTEGER PRIMARY KEY 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
+    start_time TIMESTAMP WITHOUT TIME ZONE DEFAULT '2000-01-01 00:00:00' NOT NULL,
+    end_time TIMESTAMP WITHOUT TIME ZONE DEFAULT '2000-01-01 00:00:00' NOT NULL,
+    duration REAL DEFAULT 0 NOT NULL
 );
 
 CREATE INDEX acc_cdrs_start_time_idx ON acc_cdrs (start_time);

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

@@ -9,8 +9,8 @@ CREATE TABLE silo (
     exp_time INTEGER DEFAULT 0 NOT NULL,
     snd_time INTEGER DEFAULT 0 NOT NULL,
     ctype VARCHAR(32) DEFAULT 'text/plain' NOT NULL,
-    body BLOB DEFAULT '' NOT NULL,
-    extra_hdrs TEXT DEFAULT '' NOT NULL,
+    body BLOB,
+    extra_hdrs TEXT,
     callid VARCHAR(128) DEFAULT '' NOT NULL,
     status INTEGER DEFAULT 0 NOT NULL
 );

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

@@ -1 +1 @@
-id(int,auto) src_addr(string) dst_addr(string) username(string) domain(string) inc_time(int) exp_time(int) snd_time(int) ctype(string) body(string) extra_hdrs(string) callid(string) status(int) 
+id(int,auto) src_addr(string) dst_addr(string) username(string) domain(string) inc_time(int) exp_time(int) snd_time(int) ctype(string) body(string,null) extra_hdrs(string,null) callid(string) status(int) 

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

@@ -15,9 +15,9 @@ CREATE INDEX callid_idx ON acc (callid);
 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 DATETIME DEFAULT '' NOT NULL,
-    end_time DATETIME DEFAULT '' NOT NULL,
-    duration FLOAT(10,3) DEFAULT '' NOT NULL
+    start_time DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL,
+    end_time DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL,
+    duration FLOAT(10,3) DEFAULT 0 NOT NULL
 );
 
 CREATE INDEX start_time_idx ON acc_cdrs (start_time);

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

@@ -9,8 +9,8 @@ CREATE TABLE silo (
     exp_time INT DEFAULT 0 NOT NULL,
     snd_time INT DEFAULT 0 NOT NULL,
     ctype VARCHAR(32) DEFAULT 'text/plain' NOT NULL,
-    body BLOB DEFAULT '' NOT NULL,
-    extra_hdrs TEXT DEFAULT '' NOT NULL,
+    body BLOB,
+    extra_hdrs TEXT,
     callid VARCHAR(128) DEFAULT '' NOT NULL,
     status INT DEFAULT 0 NOT NULL
 );

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

@@ -23,9 +23,9 @@ CREATE INDEX acc_callid_idx  ON acc (callid);
 INSERT INTO version (table_name, table_version) values ('acc_cdrs','2');
 CREATE TABLE acc_cdrs (
     id NUMBER(10) PRIMARY KEY,
-    start_time DATE DEFAULT '',
-    end_time DATE DEFAULT '',
-    duration NUMBER(10,3) DEFAULT ''
+    start_time DATE DEFAULT '2000-01-01 00:00:00',
+    end_time DATE DEFAULT '2000-01-01 00:00:00',
+    duration NUMBER(10,3) DEFAULT 0 NOT NULL
 );
 
 CREATE OR REPLACE TRIGGER acc_cdrs_tr

+ 2 - 2
utils/kamctl/oracle/msilo-create.sql

@@ -9,8 +9,8 @@ CREATE TABLE silo (
     exp_time NUMBER(10) DEFAULT 0 NOT NULL,
     snd_time NUMBER(10) DEFAULT 0 NOT NULL,
     ctype VARCHAR2(32) DEFAULT 'text/plain',
-    body BLOB DEFAULT '',
-    extra_hdrs CLOB DEFAULT '',
+    body BLOB,
+    extra_hdrs CLOB,
     callid VARCHAR2(128) DEFAULT '',
     status NUMBER(10) DEFAULT 0 NOT NULL
 );

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

@@ -15,9 +15,9 @@ CREATE INDEX acc_callid_idx ON acc (callid);
 INSERT INTO version (table_name, table_version) values ('acc_cdrs','2');
 CREATE TABLE acc_cdrs (
     id SERIAL PRIMARY KEY 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
+    start_time TIMESTAMP WITHOUT TIME ZONE DEFAULT '2000-01-01 00:00:00' NOT NULL,
+    end_time TIMESTAMP WITHOUT TIME ZONE DEFAULT '2000-01-01 00:00:00' NOT NULL,
+    duration REAL DEFAULT 0 NOT NULL
 );
 
 CREATE INDEX acc_cdrs_start_time_idx ON acc_cdrs (start_time);

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

@@ -9,8 +9,8 @@ CREATE TABLE silo (
     exp_time INTEGER DEFAULT 0 NOT NULL,
     snd_time INTEGER DEFAULT 0 NOT NULL,
     ctype VARCHAR(32) DEFAULT 'text/plain' NOT NULL,
-    body BYTEA DEFAULT '' NOT NULL,
-    extra_hdrs TEXT DEFAULT '' NOT NULL,
+    body BYTEA,
+    extra_hdrs TEXT,
     callid VARCHAR(128) DEFAULT '' NOT NULL,
     status INTEGER DEFAULT 0 NOT NULL
 );