Browse code

- change dbschema xsl to not add one space char to files - this prevents the generation of empty files, e.g. openser-extensions.xml - remove this empty files from mysql and postgresql - fix extra modules generation in openserdbctl.mysql - add openser-extensions table generation to .mysql and .psql db scripts

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@2639 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 27/08/2007 13:29:30
Showing 52 changed files
... ...
@@ -24,4 +24,3 @@ CREATE TABLE missed_calls (
24 24
     KEY mc_callid_idx (callid)
25 25
 ) ENGINE=MyISAM;
26 26
 
27
- 
28 27
\ No newline at end of file
... ...
@@ -9,4 +9,3 @@ CREATE TABLE dbaliases (
9 9
     KEY alias_user (username, domain)
10 10
 ) ENGINE=MyISAM;
11 11
 
12
- 
13 12
\ No newline at end of file
... ...
@@ -16,4 +16,3 @@ CREATE TABLE subscriber (
16 16
     KEY username_id (username)
17 17
 ) ENGINE=MyISAM;
18 18
 
19
- 
20 19
\ No newline at end of file
... ...
@@ -12,4 +12,3 @@ CREATE TABLE usr_preferences (
12 12
     KEY uda_idx (username, domain, attribute)
13 13
 ) ENGINE=MyISAM;
14 14
 
15
- 
16 15
\ No newline at end of file
... ...
@@ -18,4 +18,3 @@ CREATE TABLE route_tree (
18 18
     carrier VARCHAR(64) DEFAULT NULL
19 19
 ) ENGINE=MyISAM;
20 20
 
21
- 
22 21
\ No newline at end of file
... ...
@@ -8,4 +8,3 @@ CREATE TABLE cpl (
8 8
     UNIQUE KEY ud_cpl (username, domain)
9 9
 ) ENGINE=MyISAM;
10 10
 
11
- 
12 11
\ No newline at end of file
... ...
@@ -22,4 +22,3 @@ CREATE TABLE dialog (
22 22
     KEY ei_dialog (hash_entry, hash_id)
23 23
 ) ENGINE=MyISAM;
24 24
 
25
- 
26 25
\ No newline at end of file
... ...
@@ -6,4 +6,3 @@ CREATE TABLE dispatcher (
6 6
     description VARCHAR(64) NOT NULL DEFAULT ''
7 7
 ) ENGINE=MyISAM;
8 8
 
9
- 
10 9
\ No newline at end of file
... ...
@@ -6,4 +6,3 @@ CREATE TABLE domain (
6 6
     UNIQUE KEY d_domain (domain)
7 7
 ) ENGINE=MyISAM;
8 8
 
9
- 
10 9
\ No newline at end of file
... ...
@@ -10,4 +10,3 @@ CREATE TABLE domainpolicy (
10 10
     KEY rule_idx (rule)
11 11
 ) ENGINE=MyISAM;
12 12
 
13
- 
14 13
\ No newline at end of file
15 14
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
- 
2 1
\ No newline at end of file
... ...
@@ -16,4 +16,3 @@ CREATE TABLE re_grp (
16 16
     KEY gid_grp (group_id)
17 17
 ) ENGINE=MyISAM;
18 18
 
19
- 
20 19
\ No newline at end of file
... ...
@@ -17,4 +17,3 @@ CREATE TABLE imc_members (
17 17
     UNIQUE KEY ndr_imc (username, domain, room)
18 18
 ) ENGINE=MyISAM;
19 19
 
20
- 
21 20
\ No newline at end of file
... ...
@@ -31,4 +31,3 @@ CREATE TABLE lcr (
31 31
     KEY lcr_grp_id_idx (grp_id)
32 32
 ) ENGINE=MyISAM;
33 33
 
34
- 
35 34
\ No newline at end of file
... ...
@@ -13,4 +13,3 @@ CREATE TABLE silo (
13 13
     KEY ud_silo (username, domain)
14 14
 ) ENGINE=MyISAM;
15 15
 
16
- 
17 16
\ No newline at end of file
... ...
@@ -7,4 +7,3 @@ CREATE TABLE pdt (
7 7
     UNIQUE KEY sp_pdt (sdomain, prefix)
8 8
 ) ENGINE=MyISAM;
9 9
 
10
- 
11 10
\ No newline at end of file
... ...
@@ -17,4 +17,3 @@ CREATE TABLE address (
17 17
     port SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0
18 18
 ) ENGINE=MyISAM;
19 19
 
20
- 
21 20
\ No newline at end of file
... ...
@@ -83,4 +83,3 @@ CREATE TABLE pua (
83 83
     extra_headers TEXT NOT NULL
84 84
 ) ENGINE=MyISAM;
85 85
 
86
- 
87 86
\ No newline at end of file
... ...
@@ -19,4 +19,3 @@ CREATE TABLE aliases (
19 19
     KEY udc_als (username, domain, contact)
20 20
 ) ENGINE=MyISAM;
21 21
 
22
- 
23 22
\ No newline at end of file
... ...
@@ -90,4 +90,3 @@ CREATE TABLE admin_privileges (
90 90
     PRIMARY KEY sw_ap_idx (username, priv_name, priv_value, domain)
91 91
 ) ENGINE=MyISAM;
92 92
 
93
- 
94 93
\ No newline at end of file
... ...
@@ -17,4 +17,3 @@ CREATE TABLE sip_trace (
17 17
     KEY call_id (callid)
18 18
 ) ENGINE=MyISAM;
19 19
 
20
- 
21 20
\ No newline at end of file
... ...
@@ -12,4 +12,3 @@ CREATE TABLE speed_dial (
12 12
     UNIQUE KEY udss_sd (username, domain, sd_domain, sd_username)
13 13
 ) ENGINE=MyISAM;
14 14
 
15
- 
16 15
\ No newline at end of file
... ...
@@ -3,4 +3,3 @@ CREATE TABLE version (
3 3
     table_version INT UNSIGNED NOT NULL DEFAULT 0
4 4
 ) ENGINE=MyISAM;
5 5
 
6
- 
7 6
\ No newline at end of file
... ...
@@ -8,4 +8,3 @@ CREATE TABLE uri (
8 8
     UNIQUE KEY udu_uri (username, domain, uri_user)
9 9
 ) ENGINE=MyISAM;
10 10
 
11
- 
12 11
\ No newline at end of file
... ...
@@ -19,4 +19,3 @@ CREATE TABLE location (
19 19
     KEY udc_loc (username, domain, contact)
20 20
 ) ENGINE=MyISAM;
21 21
 
22
- 
23 22
\ No newline at end of file
... ...
@@ -162,6 +162,16 @@ done
162 162
 
163 163
 minfo "Core OpenSER tables succesfully created."
164 164
 
165
+if [ -e $DB_SCHEMA/extensions-create.sql ]
166
+then
167
+	minfo "Creating custom extensions tables"
168
+	sql_query $1 < $DB_SCHEMA/extensions-create.sql
169
+	if [ $? -ne 0 ] ; then
170
+	merr "Creating custom extensions tables failed!"
171
+	exit 1
172
+	fi
173
+fi
174
+
165 175
 echo -n "Install presence related tables ?(y/n):"
166 176
 read INPUT
167 177
 if [ "$INPUT" = "y" ] || [ "$INPUT" = "Y" ]
... ...
@@ -216,13 +226,14 @@ fi
216 216
 
217 217
 minfo "creating extra tables into $1 ..."
218 218
 
219
-sql_query $1 < $DB_SCHEMA/extensions-create.sql 
220
-
221
-if [ $? -ne 0 ] ; then
222
-	merr "Creating extra tables failed!"
223
-	exit 1
224
-fi
225
-
219
+for TABLE in $EXTRA_MODULES; do
220
+	mdbg "Creating extra table: $TABLE"
221
+	sql_query $1 < $DB_SCHEMA/$TABLE-create.sql
222
+	if [ $? -ne 0 ] ; then
223
+		merr "Creating extra tables failed!"
224
+		exit 1
225
+		fi
226
+	done
226 227
 minfo "Extra tables succesfully created."
227 228
 }  # end extra_create
228 229
 
... ...
@@ -167,6 +167,16 @@ if [ $? -ne 0 ] ; then
167 167
 	exit 1
168 168
 fi
169 169
 
170
+if [ -e $DB_SCHEMA/extensions-create.sql ]
171
+then
172
+	minfo "Creating custom extensions tables"
173
+	sql_query $1 < $DB_SCHEMA/extensions-create.sql
174
+	if [ $? -ne 0 ] ; then
175
+	merr "Creating custom extensions tables failed!"
176
+	exit 1
177
+	fi
178
+fi
179
+
170 180
 minfo "Core OpenSER tables succesfully created."
171 181
 
172 182
 echo -n "Install presence related tables ?(y/n):"
... ...
@@ -26,4 +26,3 @@ CREATE TABLE missed_calls (
26 26
 
27 27
 CREATE INDEX mc_callid_idx ON missed_calls (callid);
28 28
 
29
- 
30 29
\ No newline at end of file
... ...
@@ -10,4 +10,3 @@ CREATE TABLE dbaliases (
10 10
 
11 11
 CREATE INDEX alias_user ON dbaliases (username, domain);
12 12
 
13
- 
14 13
\ No newline at end of file
... ...
@@ -17,4 +17,3 @@ CREATE TABLE subscriber (
17 17
 
18 18
 CREATE INDEX username_id ON subscriber (username);
19 19
 
20
- 
21 20
\ No newline at end of file
... ...
@@ -13,4 +13,3 @@ CREATE TABLE usr_preferences (
13 13
 CREATE INDEX ua_idx ON usr_preferences (uuid, attribute);
14 14
 CREATE INDEX uda_idx ON usr_preferences (username, domain, attribute);
15 15
 
16
- 
17 16
\ No newline at end of file
... ...
@@ -18,4 +18,3 @@ CREATE TABLE route_tree (
18 18
     carrier VARCHAR(64) DEFAULT NULL
19 19
 );
20 20
 
21
- 
22 21
\ No newline at end of file
... ...
@@ -8,4 +8,3 @@ CREATE TABLE cpl (
8 8
     CONSTRAINT ud_cpl UNIQUE (username, domain)
9 9
 );
10 10
 
11
- 
12 11
\ No newline at end of file
... ...
@@ -23,4 +23,3 @@ CREATE TABLE dialog (
23 23
 
24 24
 CREATE INDEX ei_dialog ON dialog (hash_entry, hash_id);
25 25
 
26
- 
27 26
\ No newline at end of file
... ...
@@ -6,4 +6,3 @@ CREATE TABLE dispatcher (
6 6
     description VARCHAR(64) NOT NULL DEFAULT ''
7 7
 );
8 8
 
9
- 
10 9
\ No newline at end of file
... ...
@@ -6,4 +6,3 @@ CREATE TABLE domain (
6 6
     CONSTRAINT d_domain UNIQUE (domain)
7 7
 );
8 8
 
9
- 
10 9
\ No newline at end of file
... ...
@@ -11,4 +11,3 @@ CREATE TABLE domainpolicy (
11 11
 
12 12
 CREATE INDEX rule_idx ON domainpolicy (rule);
13 13
 
14
- 
15 14
\ No newline at end of file
16 15
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
- 
2 1
\ No newline at end of file
... ...
@@ -17,4 +17,3 @@ CREATE TABLE re_grp (
17 17
 
18 18
 CREATE INDEX gid_grp ON re_grp (group_id);
19 19
 
20
- 
21 20
\ No newline at end of file
... ...
@@ -17,4 +17,3 @@ CREATE TABLE imc_members (
17 17
     CONSTRAINT ndr_imc UNIQUE (username, domain, room)
18 18
 );
19 19
 
20
- 
21 20
\ No newline at end of file
... ...
@@ -33,4 +33,3 @@ CREATE INDEX lcr_prefix_idx ON lcr (prefix);
33 33
 CREATE INDEX lcr_from_uri_idx ON lcr (from_uri);
34 34
 CREATE INDEX lcr_grp_id_idx ON lcr (grp_id);
35 35
 
36
- 
37 36
\ No newline at end of file
... ...
@@ -14,4 +14,3 @@ CREATE TABLE silo (
14 14
 
15 15
 CREATE INDEX ud_silo ON silo (username, domain);
16 16
 
17
- 
18 17
\ No newline at end of file
... ...
@@ -7,4 +7,3 @@ CREATE TABLE pdt (
7 7
     CONSTRAINT sp_pdt UNIQUE (sdomain, prefix)
8 8
 );
9 9
 
10
- 
11 10
\ No newline at end of file
... ...
@@ -18,4 +18,3 @@ CREATE TABLE address (
18 18
     port SMALLINT NOT NULL DEFAULT 0
19 19
 );
20 20
 
21
- 
22 21
\ No newline at end of file
... ...
@@ -84,4 +84,3 @@ CREATE TABLE pua (
84 84
     extra_headers TEXT NOT NULL
85 85
 );
86 86
 
87
- 
88 87
\ No newline at end of file
... ...
@@ -20,4 +20,3 @@ CREATE TABLE aliases (
20 20
 
21 21
 CREATE INDEX udc_als ON aliases (username, domain, contact);
22 22
 
23
- 
24 23
\ No newline at end of file
... ...
@@ -92,4 +92,3 @@ CREATE TABLE admin_privileges (
92 92
     CONSTRAINT sw_ap_idx PRIMARY KEY sw_ap_idx (username, priv_name, priv_value, domain)
93 93
 );
94 94
 
95
- 
96 95
\ No newline at end of file
... ...
@@ -18,4 +18,3 @@ CREATE INDEX date_id ON sip_trace (date);
18 18
 CREATE INDEX ip_idx ON sip_trace (fromip);
19 19
 CREATE INDEX call_id ON sip_trace (callid);
20 20
 
21
- 
22 21
\ No newline at end of file
... ...
@@ -12,4 +12,3 @@ CREATE TABLE speed_dial (
12 12
     CONSTRAINT udss_sd UNIQUE (username, domain, sd_domain, sd_username)
13 13
 );
14 14
 
15
- 
16 15
\ No newline at end of file
... ...
@@ -3,4 +3,3 @@ CREATE TABLE version (
3 3
     table_version INTEGER NOT NULL DEFAULT 0
4 4
 );
5 5
 
6
- 
7 6
\ No newline at end of file
... ...
@@ -8,4 +8,3 @@ CREATE TABLE uri (
8 8
     CONSTRAINT udu_uri UNIQUE (username, domain, uri_user)
9 9
 );
10 10
 
11
- 
12 11
\ No newline at end of file
... ...
@@ -20,4 +20,3 @@ CREATE TABLE location (
20 20
 
21 21
 CREATE INDEX udc_loc ON location (username, domain, contact);
22 22
 
23
- 
24 23
\ No newline at end of file