| Commit in PEAR_Server/Server on MAIN | |||
| mysqlinstall.php | +32 | 1.30 -> 1.31 | |
add code to update database for channel field size
diff -u -r1.30 -r1.31 --- mysqlinstall.php 12 Nov 2005 17:45:39 -0000 1.30 +++ mysqlinstall.php 4 Feb 2006 03:06:00 -0000 1.31 @@ -351,6 +351,38 @@
return $a;
}
}
+ // channel field size upgrade
+ if (extension_loaded('mysqli')) {
+ $query = @mysqli_query($conn, 'SHOW COLUMNS FROM maintainers');
+ while ($res = mysqli_fetch_array($query, MYSQLI_ASSOC)) {
+ if ($res['Field'] == 'channel') {
+ if ($res['Type'] == 'varchar(255)') {
+ $upgraded = true;
+ } else {
+ $upgraded = false;
+ }
+ }
+ }
+ } else {
+ $query = @mysql_query('SHOW COLUMNS FROM maintainers', $conn);
+ while ($res = mysql_fetch_array($query, MYSQLI_ASSOC)) {
+ if ($res['Field'] == 'channel') {
+ if ($res['Type'] == 'varchar(255)') {
+ $upgraded = true;
+ } else {
+ $upgraded = false;
+ }
+ }
+ }
+ }
+ if (!$upgraded) {
+ $a = $this->updateDatabase(
+ '@data-dir@/Chiara_PEAR_Server/data/maintainers-channel-0.18.4.sql',
+ 'updating database to increase size of channel field', $conn);
+ if (!$a) {
+ return $a;
+ }
+ }
return $this->checkSetup();
}
} else {