Browse code

- Default values for columns which must not have NULL value

Jan Janak authored on 28/10/2003 12:10:33
Showing 1 changed files
... ...
@@ -40,6 +40,14 @@ USERCOL="username"
40 40
 
41 41
 GENHA1='gen_ha1'
42 42
 
43
+FOREVER="2020-05-28 21:32:15"
44
+
45
+DEFAULT_ALIASES_EXPIRES=$FOREVER
46
+DEFAULT_Q="1.0"
47
+DEFAULT_CALLID="Default-Call-ID"
48
+DEFAULT_CSEQ="42"
49
+DEFAULT_LOCATION_EXPIRES=$FOREVER
50
+
43 51
 #################################################################
44 52
 
45 53
 
... ...
@@ -216,10 +224,10 @@ INSERT INTO version VALUES ( 'reserved', '1');
216 224
 INSERT INTO version VALUES ( 'phonebook', '1');
217 225
 INSERT INTO version VALUES ( 'pending', '3');
218 226
 INSERT INTO version VALUES ( 'missed_calls', '2');
219
-INSERT INTO version VALUES ( 'location', '3');
227
+INSERT INTO version VALUES ( 'location', '4');
220 228
 INSERT INTO version VALUES ( 'grp', '2');
221 229
 INSERT INTO version VALUES ( 'event', '1');
222
-INSERT INTO version VALUES ( 'aliases', '3');
230
+INSERT INTO version VALUES ( 'aliases', '4');
223 231
 INSERT INTO version VALUES ( 'active_sessions', '1');
224 232
 INSERT INTO version VALUES ( 'acc', '2');
225 233
 INSERT INTO version VALUES ( 'config', '1');
... ...
@@ -282,13 +290,13 @@ CREATE TABLE aliases (
282 290
   $USERCOL varchar(64) NOT NULL default '',
283 291
   domain varchar(128) NOT NULL default '',
284 292
   contact varchar(255) NOT NULL default '',
285
-  expires datetime default NULL,
286
-  q float(10,2) default NULL,
287
-  callid varchar(255) default NULL,
288
-  cseq int(11) default NULL,
293
+  expires datetime NOT NULL default '$DEFAULT_ALIASES_EXPIRES',
294
+  q float(10,2) NOT NULL default '$DEFAULT_Q',
295
+  callid varchar(255) NOT NULL default '$DEFAULT_CALLID',
296
+  cseq int(11) NOT NULL default '$DEFAULT_CSEQ',
289 297
   last_modified timestamp(14) NOT NULL,
290
-  replicate int(10) unsigned default NULL,
291
-  state tinyint(1) unsigned default NULL,
298
+  replicate int(10) unsigned NOT NULL default '0',
299
+  state tinyint(1) unsigned NOT NULL default '0',
292 300
   flags int(11) NOT NULL default '0',
293 301
   PRIMARY KEY($USERCOL, domain, contact)
294 302
 ) $TABLE_TYPE;
... ...
@@ -336,13 +344,13 @@ CREATE TABLE location (
336 344
   $USERCOL varchar(64) NOT NULL default '',
337 345
   domain varchar(128) NOT NULL default '',
338 346
   contact varchar(255) NOT NULL default '',
339
-  expires datetime default NULL,
340
-  q float(10,2) default NULL,
341
-  callid varchar(255) default NULL,
342
-  cseq int(11) default NULL,
347
+  expires datetime NOT NULL default '$DEFAULT_LOCATION_EXPIRES',
348
+  q float(10,2) NOT NULL default '$DEFAULT_Q',
349
+  callid varchar(255) NOT NULL default '$DEFAULT_CALLID',
350
+  cseq int(11) NOT NULL default '$DEFAULT_CSEQ',
343 351
   last_modified timestamp(14) NOT NULL,
344
-  replicate int(10) unsigned default NULL,
345
-  state tinyint(1) unsigned default NULL,
352
+  replicate int(10) unsigned NOT NULL default '0',
353
+  state tinyint(1) unsigned NOT NULL default '0',
346 354
   flags int(11) NOT NULL default '0',
347 355
   PRIMARY KEY($USERCOL, domain, contact)
348 356
 ) $TABLE_TYPE;