Changeset 4055

Show
Ignore:
Timestamp:
06/12/07 16:11:06 (6 years ago)
Author:
p_lindheimer
Message:

#1989 - maximize the size of sip, zap, iax data field to maximum varchar supported by mysql 4.x to deal with long data lines

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.2/upgrades/2.2.3/tables.php

    r2733 r4055  
    11<?php 
    22 
     3outn("Alter tables sip, iax, zap to increase field length .."); 
     4$db->query("ALTER TABLE sip CHANGE data data VARCHAR( 255 ) NOT NULL"); 
     5$db->query("ALTER TABLE iax CHANGE data data VARCHAR( 255 ) NOT NULL"); 
     6$db->query("ALTER TABLE zap CHANGE data data VARCHAR( 255 ) NOT NULL"); 
     7out("Altered"); 
    38 
    4 outn("Upgrading Inbound Routing to allow for RINGING signalling.."); 
    5  
    6 $sql = "SELECT ringing FROM incoming"; 
    7 $confs = $db->getRow($sql, DB_FETCHMODE_ASSOC); 
    8 if (!DB::IsError($confs)) { // no error... Already done 
    9   out("Not Required"); 
    10 } else { 
    11   $sql = "ALTER TABLE incoming ADD ringing VARCHAR ( 20 ) NULL "; 
    12   $results = $db->query($sql); 
    13   if(DB::IsError($results)) { 
    14           die($results->getMessage()); 
    15   } 
    16   out("Done"); 
    17 } 
    18  
    19  
    20 outn("Upgrading Users/Extension Table to allow for Fax Receipt.."); 
    21  
    22 $sql = "SELECT faxexten FROM users"; 
    23 $confs = $db->getRow($sql, DB_FETCHMODE_ASSOC); 
    24 if (!DB::IsError($confs)) { // no error... Already done 
    25   out("Not Required"); 
    26 } else { 
    27   $sql = "ALTER TABLE users ADD faxexten VARCHAR ( 20 ) NULL "; 
    28   $results = $db->query($sql); 
    29   if(DB::IsError($results)) { 
    30           die($results->getMessage()); 
    31   } 
    32   out("Done"); 
    33 } 
    34  
    35 $sql = "SELECT faxemail FROM users"; 
    36 $confs = $db->getRow($sql, DB_FETCHMODE_ASSOC); 
    37 if (!DB::IsError($confs)) { // no error... Already done 
    38   out("Not Required"); 
    39 } else { 
    40   $sql = "ALTER TABLE users ADD faxemail VARCHAR ( 50 ) NULL "; 
    41   $results = $db->query($sql); 
    42   if(DB::IsError($results)) { 
    43           die($results->getMessage()); 
    44   } 
    45   out("Done"); 
    46 } 
    47  
    48 $sql = "SELECT answer FROM users"; 
    49 $confs = $db->getRow($sql, DB_FETCHMODE_ASSOC); 
    50 if (!DB::IsError($confs)) { // no error... Already done 
    51   out("Not Required"); 
    52 } else { 
    53   $sql = "ALTER TABLE users ADD answer TINYINT ( 1 ) NULL "; 
    54   $results = $db->query($sql); 
    55   if(DB::IsError($results)) { 
    56           die($results->getMessage()); 
    57   } 
    58   out("Done"); 
    59 } 
    60  
    61 $sql = "SELECT wait FROM users"; 
    62 $confs = $db->getRow($sql, DB_FETCHMODE_ASSOC); 
    63 if (!DB::IsError($confs)) { // no error... Already done 
    64   out("Not Required"); 
    65 } else { 
    66   $sql = "ALTER TABLE users ADD wait INT ( 2 ) NULL "; 
    67   $results = $db->query($sql); 
    68   if(DB::IsError($results)) { 
    69           die($results->getMessage()); 
    70   } 
    71   out("Done"); 
    72 } 
    73  
    74 outn("Upgrading Users/Extension Table to allow for Privacy Manager.."); 
    75  
    76 $sql = "SELECT privacyman FROM users"; 
    77 $confs = $db->getRow($sql, DB_FETCHMODE_ASSOC); 
    78 if (!DB::IsError($confs)) { // no error... Already done 
    79   out("Not Required"); 
    80 } else { 
    81   $sql = "ALTER TABLE users ADD privacyman TINYINT ( 1 ) NULL "; 
    82   $results = $db->query($sql); 
    83   if(DB::IsError($results)) { 
    84           die($results->getMessage()); 
    85   } 
    86   out("Done"); 
    87 } 
    88  
    89 outn("Checking for Global var OPERATOR_XTN.."); 
    90 $nrows = $db->getOne("SELECT count(*) from globals where variable='OPERATOR_XTN'"); 
    91 if (!$nrows) { 
    92   $db->query("insert into globals values ('OPERATOR_XTN', '')"); 
    93   out("Created"); 
    94 } else { 
    95   out("Already exists!"); 
    96 } 
    97  
    98 outn("Checking for Global var VM_OPTS.."); 
    99 $nrows = $db->getOne("SELECT count(*) from globals where variable='VM_OPTS'"); 
    100 if (!$nrows) { 
    101   $db->query("insert into globals values ('VM_OPTS', '')"); 
    102   out("Created"); 
    103 } else { 
    104   out("Already exists!"); 
    105 } 
    106  
    107 outn("Checking for Global var TIMEFORMAT.."); 
    108 $nrows = $db->getOne("SELECT count(*) from globals where variable='TIMEFORMAT'"); 
    109 if (!$nrows) { 
    110   $db->query("insert into globals values ('TIMEFORMAT', 'kM')"); 
    111   out("Created"); 
    112 } else { 
    113   out("Already exists!"); 
    114 } 
    1159?>