浏览代码

- modifications for postgres

Jan Janak 20 年之前
父节点
当前提交
92e4c4c221

+ 4 - 4
db/schema/acc.xml

@@ -88,22 +88,22 @@
     <column>
     <column>
 	<name>time</name>
 	<name>time</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default>0000-00-00 00:00:00</default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <column>
     <column>
 	<name>timestamp</name>
 	<name>timestamp</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default></default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <column>
     <column>
 	<name>caller_deleted</name>
 	<name>caller_deleted</name>
 	<type>char</type>
 	<type>char</type>
-	<default></default>
+	<default>0</default>
     </column>
     </column>
     <column>
     <column>
 	<name>callee_deleted</name>
 	<name>callee_deleted</name>
 	<type>char</type>
 	<type>char</type>
-	<default></default>
+	<default>0</default>
     </column>
     </column>
     <index>
     <index>
 	<name>acc_user</name>
 	<name>acc_user</name>

+ 1 - 0
db/schema/admin_privileges.xml

@@ -36,6 +36,7 @@
 	<size>64</size>
 	<size>64</size>
     </column>
     </column>
     <index>
     <index>
+	<name>adminpriv_idx1</name>
 	<colref linkend="username"/>
 	<colref linkend="username"/>
 	<colref linkend="priv_name"/>
 	<colref linkend="priv_name"/>
 	<colref linkend="priv_value"/>
 	<colref linkend="priv_value"/>

+ 2 - 2
db/schema/aliases.xml

@@ -39,7 +39,7 @@
     <column>
     <column>
 	<name>expires</name>
 	<name>expires</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default>1234</default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <column>
     <column>
 	<name>q</name>
 	<name>q</name>
@@ -60,7 +60,7 @@
     <column>
     <column>
 	<name>last_modified</name>
 	<name>last_modified</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default></default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <column>
     <column>
 	<name>replicate</name>
 	<name>replicate</name>

+ 2 - 1
db/schema/domain.xml

@@ -20,9 +20,10 @@
     <column>
     <column>
 	<name>last_modified</name>
 	<name>last_modified</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default>0</default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <index>
     <index>
+	<name>domain_idx1</name>
 	<colref linkend="domain"/>
 	<colref linkend="domain"/>
     </index>
     </index>
 </table>
 </table>

+ 1 - 0
db/schema/event.xml

@@ -40,6 +40,7 @@
 	<size>128</size>
 	<size>128</size>
     </column>
     </column>
     <index>
     <index>
+	<name>id</name>
 	<colref linkend="id"/>
 	<colref linkend="id"/>
     </index>
     </index>
 </table>
 </table>

+ 2 - 1
db/schema/grp.xml

@@ -32,9 +32,10 @@
     <column>
     <column>
 	<name>last_modified</name>
 	<name>last_modified</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default></default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <index>
     <index>
+	<name>grp_idx</name>
 	<colref linkend="username"/>
 	<colref linkend="username"/>
 	<colref linkend="domain"/>
 	<colref linkend="domain"/>
 	<colref linkend="grp"/>
 	<colref linkend="grp"/>

+ 2 - 0
db/schema/gw.xml

@@ -39,9 +39,11 @@
 	<type>int</type>
 	<type>int</type>
     </column>
     </column>
     <index>
     <index>
+	<name>gw_idx1</name>
 	<colref linkend="gw_name"/>
 	<colref linkend="gw_name"/>
     </index>
     </index>
     <index>
     <index>
+	<name>gw_idx2</name>
 	<colref linkend="grp_id"/>
 	<colref linkend="grp_id"/>
     </index>
     </index>
 </table>
 </table>

+ 4 - 1
db/schema/lcr.xml

@@ -17,7 +17,7 @@
     </column>
     </column>
     <column id="from_uri">
     <column id="from_uri">
 	<name>from_uri</name>
 	<name>from_uri</name>
-	<type>int</type>
+	<type>string</type>
 	<default>%</default>
 	<default>%</default>
 	<size>&uri_len;</size>
 	<size>&uri_len;</size>
     </column>
     </column>
@@ -32,12 +32,15 @@
 	<null/>
 	<null/>
     </column>
     </column>
     <index>
     <index>
+	<name>lcr_idx1</name>
 	<colref linkend="prefix"/>
 	<colref linkend="prefix"/>
     </index>
     </index>
     <index>
     <index>
+	<name>lcr_idx2</name>
 	<colref linkend="from_uri"/>
 	<colref linkend="from_uri"/>
     </index>
     </index>
     <index>
     <index>
+	<name>lcr_idx3</name>
 	<colref linkend="grp_id"/>
 	<colref linkend="grp_id"/>
     </index>
     </index>
 </table>
 </table>

+ 4 - 4
db/schema/location.xml

@@ -38,7 +38,7 @@
     <column>
     <column>
 	<name>expires</name>
 	<name>expires</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default>1234</default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <column>
     <column>
 	<name>q</name>
 	<name>q</name>
@@ -59,7 +59,7 @@
     <column>
     <column>
 	<name>last_modified</name>
 	<name>last_modified</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default></default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <column>
     <column>
 	<name>replicate</name>
 	<name>replicate</name>
@@ -83,13 +83,13 @@
 	<size>64</size>
 	<size>64</size>
     </column>
     </column>
     <index>
     <index>
-	<name>main_key</name>
+	<name>location_key</name>
 	<colref linkend="username"/>
 	<colref linkend="username"/>
 	<colref linkend="domain"/>
 	<colref linkend="domain"/>
 	<colref linkend="contact"/>
 	<colref linkend="contact"/>
     </index>
     </index>
     <index>
     <index>
-	<name>aliases_contact</name>
+	<name>location_contact</name>
 	<colref linkend="contact"/>
 	<colref linkend="contact"/>
     </index>
     </index>
 </table>
 </table>

+ 2 - 2
db/schema/missed_calls.xml

@@ -91,12 +91,12 @@
     <column>
     <column>
 	<name>time</name>
 	<name>time</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default>0</default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <column>
     <column>
 	<name>timestamp</name>
 	<name>timestamp</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default></default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <index>
     <index>
 	<name>mc_user</name>
 	<name>mc_user</name>

+ 5 - 4
db/schema/pending.xml

@@ -62,12 +62,12 @@
     <column>
     <column>
 	<name>datetime_created</name>
 	<name>datetime_created</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default>0</default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <column>
     <column>
 	<name>datetime_modified</name>
 	<name>datetime_modified</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default>0</default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <column>
     <column>
 	<name>confirmation</name>
 	<name>confirmation</name>
@@ -126,7 +126,7 @@
     <column>
     <column>
 	<name>domn</name>
 	<name>domn</name>
 	<type>unsigned int</type>
 	<type>unsigned int</type>
-	<default></default>
+	<default>0</default>
 	<size>10</size>
 	<size>10</size>
     </column>
     </column>
     <column>
     <column>
@@ -136,6 +136,7 @@
 	<size>&uuid_len;</size>
 	<size>&uuid_len;</size>
     </column>
     </column>
     <index>
     <index>
+	<name>pending_idx1</name>
 	<colref linkend="username"/>
 	<colref linkend="username"/>
 	<colref linkend="domain"/>
 	<colref linkend="domain"/>
     </index>
     </index>
@@ -144,7 +145,7 @@
 	<colref linkend="username"/>
 	<colref linkend="username"/>
     </index>
     </index>
     <index>
     <index>
-	<name>phplib_id</name>
+	<name>php</name>
 	<colref linkend="phplib_id"/>
 	<colref linkend="phplib_id"/>
     </index>
     </index>
 </table>
 </table>

+ 2 - 1
db/schema/phonebook.xml

@@ -14,7 +14,7 @@
     <column id="id">
     <column id="id">
 	<name>id</name>
 	<name>id</name>
 	<type>unsigned int</type>
 	<type>unsigned int</type>
-	<default></default>
+	<default>0</default>
     </column>
     </column>
     <column>
     <column>
 	<name>username</name>
 	<name>username</name>
@@ -47,6 +47,7 @@
 	<size>&uri_len;</size>
 	<size>&uri_len;</size>
     </column>
     </column>
     <index>
     <index>
+	<name>pb_idx</name>
 	<colref linkend="id"/>
 	<colref linkend="id"/>
     </index>
     </index>
 </table>
 </table>

+ 2 - 1
db/schema/server_monitoring.xml

@@ -14,7 +14,7 @@
     <column>
     <column>
 	<name>time</name>
 	<name>time</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default>0</default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <column id="id">
     <column id="id">
 	<name>id</name>
 	<name>id</name>
@@ -38,6 +38,7 @@
 	<default>0</default>
 	<default>0</default>
     </column>
     </column>
     <index>
     <index>
+	<name>sm_idx1</name>
 	<colref linkend="id"/>
 	<colref linkend="id"/>
 	<colref linkend="param"/>
 	<colref linkend="param"/>
     </index>
     </index>

+ 2 - 1
db/schema/server_monitoring_agg.xml

@@ -75,9 +75,10 @@
     <column>
     <column>
 	<name>lastupdate</name>
 	<name>lastupdate</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default>0</default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <index>
     <index>
+	<name>smagg_idx1</name>
 	<colref linkend="param"/>
 	<colref linkend="param"/>
     </index>
     </index>
 </table>
 </table>

+ 3 - 2
db/schema/silo.xml

@@ -48,12 +48,12 @@
     <column>
     <column>
 	<name>inc_time</name>
 	<name>inc_time</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default>0</default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <column>
     <column>
 	<name>exp_time</name>
 	<name>exp_time</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default>0</default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <column>
     <column>
 	<name>ctype</name>
 	<name>ctype</name>
@@ -67,6 +67,7 @@
 	<default></default>
 	<default></default>
     </column>
     </column>
     <index>
     <index>
+	<name>silo_idx1</name>
 	<colref linkend="mid"/>
 	<colref linkend="mid"/>
     </index>
     </index>
 </table>
 </table>

+ 1 - 0
db/schema/speed_dial.xml

@@ -66,6 +66,7 @@
 	<size>64</size>
 	<size>64</size>
     </column>
     </column>
     <index>
     <index>
+	<name>speeddial_idx1</name>
 	<colref linkend="username"/>
 	<colref linkend="username"/>
 	<colref linkend="domain"/>
 	<colref linkend="domain"/>
 	<colref linkend="sd_username"/>
 	<colref linkend="sd_username"/>

+ 4 - 4
db/schema/subscriber.xml

@@ -62,12 +62,12 @@
     <column>
     <column>
 	<name>datetime_created</name>
 	<name>datetime_created</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default>0</default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <column>
     <column>
 	<name>datetime_modified</name>
 	<name>datetime_modified</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default>0</default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <column>
     <column>
 	<name>confirmation</name>
 	<name>confirmation</name>
@@ -126,7 +126,7 @@
     <column>
     <column>
 	<name>domn</name>
 	<name>domn</name>
 	<type>unsigned int</type>
 	<type>unsigned int</type>
-	<default></default>
+	<default>0</default>
 	<size>10</size>
 	<size>10</size>
     </column>
     </column>
     <column>
     <column>
@@ -141,7 +141,7 @@
 	<colref linkend="domain"/>
 	<colref linkend="domain"/>
     </index>
     </index>
     <index>
     <index>
-	<name>user_2</name>
+	<name>sub_idx1</name>
 	<colref linkend="username"/>
 	<colref linkend="username"/>
     </index>
     </index>
     <index>
     <index>

+ 1 - 0
db/schema/trusted.xml

@@ -26,6 +26,7 @@
 	<size>64</size>
 	<size>64</size>
     </column>
     </column>
     <index>
     <index>
+	<name>trusted_idx</name>
 	<colref linkend="src_ip"/>
 	<colref linkend="src_ip"/>
 	<colref linkend="proto"/>
 	<colref linkend="proto"/>
 	<colref linkend="from_pattern"/>
 	<colref linkend="from_pattern"/>

+ 2 - 1
db/schema/uri.xml

@@ -31,9 +31,10 @@
     <column>
     <column>
 	<name>last_modified</name>
 	<name>last_modified</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default></default>
+	<default>1970-01-01 00:00:00</default>
     </column>
     </column>
     <index>
     <index>
+	<name>uri_idx1</name>
 	<colref linkend="username"/>
 	<colref linkend="username"/>
 	<colref linkend="domain"/>
 	<colref linkend="domain"/>
 	<colref linkend="uri_user"/>
 	<colref linkend="uri_user"/>

+ 1 - 0
db/schema/usr_preferences.xml

@@ -50,6 +50,7 @@
 	<type>datetime</type>
 	<type>datetime</type>
     </column>
     </column>
     <index>
     <index>
+	<name>up_idx</name>
 	<colref linkend="attribute"/>
 	<colref linkend="attribute"/>
 	<colref linkend="username"/>
 	<colref linkend="username"/>
 	<colref linkend="domain"/>
 	<colref linkend="domain"/>

+ 1 - 0
db/schema/usr_preferences_types.xml

@@ -40,6 +40,7 @@
 	<size>100</size>
 	<size>100</size>
     </column>
     </column>
     <index>
     <index>
+	<name>upt_idx1</name>
 	<colref linkend="att_name"/>
 	<colref linkend="att_name"/>
     </index>
     </index>
 </table>
 </table>

+ 3 - 1
db/schema/version.xml

@@ -2,7 +2,9 @@
 <!DOCTYPE table PUBLIC "-//iptel.org//DTD DBSchema V1.0//EN"
 <!DOCTYPE table PUBLIC "-//iptel.org//DTD DBSchema V1.0//EN"
   "http://iptel.org/dbschema/dtd/1.0/dbschema.dtd">
   "http://iptel.org/dbschema/dtd/1.0/dbschema.dtd">
 
 
-<table id="version" xmlns:xi="http://www.w3.org/2001/XInclude">
+<table id="version" xmlns:xi="http://www.w3.org/2001/XInclude"
+   xmlns:pg="http://iptel.org/dbschema/postgres"
+>
     <name>
     <name>
 	version
 	version
     </name>
     </name>