diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-07-29 06:17:25 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-07-29 06:17:25 +0000 |
commit | ee9999a93074c737ffc298c8370ef05a3121cfa0 (patch) | |
tree | 3d97f364ebb137e27eb0989a77efafbf4c44492f /lib/class | |
parent | 070b12d08abce6842fe2f0a66c0676438949f25c (diff) | |
download | ampache-ee9999a93074c737ffc298c8370ef05a3121cfa0.tar.gz ampache-ee9999a93074c737ffc298c8370ef05a3121cfa0.tar.bz2 ampache-ee9999a93074c737ffc298c8370ef05a3121cfa0.zip |
new update to correct normal sized blob for those already on 3.4, also added stream_* and downsample_cmd migration support, and but support I mean I tell them its not going to work
Diffstat (limited to 'lib/class')
-rw-r--r-- | lib/class/update.class.php | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/lib/class/update.class.php b/lib/class/update.class.php index 9ccd966b..bd1be7af 100644 --- a/lib/class/update.class.php +++ b/lib/class/update.class.php @@ -210,6 +210,11 @@ class Update { $version[] = array('version' => '340005','description' => $update_string); + $update_string = '- Remove Random Method config option, ended up being useless.<br />' . + '- Check and change album_data.art to a MEDIUMBLOB if needed.<br />'; + + $version[] = array('version' => '340006','description' => $update_string); + return $version; } // populate_version @@ -769,9 +774,37 @@ class Update { */ public static function update_340006() { - $sql = "ALTER TABLE `album_data` CHANGE `art` `art` MEDIUMBLOB NULL DEFAULT NULL"; + $sql = "DESCRIBE `album_data`"; + $db_results = Dba::query($sql); + + while ($row = Dba::fetch_assoc($db_results)) { + if ($row['Field'] == 'art' AND $row['Type'] == 'blob') { + $blob_needed = true; + } + } // end while + if ($blob_needed) { + $sql = "ALTER TABLE `album_data` CHANGE `art` `art` MEDIUMBLOB NULL DEFAULT NULL"; + $db_results = Dba::query($sql); + } + + // No matter what remove that random method preference + $sql = "DELETE FROM `preference` WHERE `name`='random_method'"; $db_results = Dba::query($sql); + $sql = "SELECT `id` FROM `user`"; + $db_results = Dba::query($sql); + + User::fix_preferences('-1'); + + while ($r = Dba::fetch_assoc($db_results)) { + User::fix_preferences($r['id']); + } + + self::set_version('db_version','340006'); + + return true; + + } // update_340006 } // end update class |